

***** Crisis and Convergence Article - Study 1: Aggregate-Level Analysis (1950 - 2016) : 29/09/20) *****

********* Data Analysed using Stata14 *********


** Install Data**

version 14
clear all
set more off, perm
numlabel, add
set scrollbufsize 300000
graph set window fontface "Times New Roman"

global data1 "C:\Users\zack\Documents\CrisisPaperReplicationData"     //* Alter accordingly

*** Units of Analysis ***

set obs 418
gen countryelection = _n
label variable countryelection "Country-Election Year"
label define countryelection ///
1 "Australia_51" 2 "Australia_54" 3 "Australia_55" 4 "Australia_58" 5 "Australia_61" 6 "Australia_63" 7 "Australia_66" 8 "Australia_69" 9 "Australia_72" 10 "Australia_74" 11 "Australia_75" 12 "Australia_77" 13 "Australia_80" 14 "Australia_83" 15 "Australia_84" 16 "Australia_87" 17 "Australia_90" 18 "Australia_93" 19 "Australia_96" 20 "Australia_98" 21 "Australia_01" 22 "Australia_04" 23 "Australia_07" 24 "Australia_10" 25 "Australia_13" 26 "Australia_16"  /// 
27 "Austria_53" 28 "Austria_56" 29 "Austria_59" 30 "Austria_62" 31 "Austria_66" 32 "Austria_70" 33 "Austria_71" 34 "Austria_75" 35 "Austria_79" 36 "Austria_83" 37 "Austria_86" 38 "Austria_90" 39 "Austria_94" 40 "Austria_95" 41 "Austria_99" 42 "Austria_02" 43 "Austria_06" 44 "Austria_08" 45 "Austria_13" ///               
46 "Canada_53" 47 "Canada_57" 48 "Canada_58" 49 "Canada_62" 50 "Canada_63" 51 "Canada_65" 52 "Canada_68" 53 "Canada_72" 54 "Canada_74" 55 "Canada_79" 56 "Canada_80" 57 "Canada_84" 58  "Canada_88" 59 "Canada_93" 60 "Canada_97" 61 "Canada_00" 62 "Canada_04" 63 "Canada_06" 64 "Canada_08" 65 "Canada_11" 66 "Canada_15"  ///                          
67 "Denmark_50" 68 "Denmark_53a" 69 "Denmark_53b" 70 "Denmark_57" 71 "Denmark_60" 72 "Denmark_64" 73 "Denmark_66" 74 "Denmark_68" 75 "Denmark_71" 76  "Denmark_73" 77 "Denmark_75" 78 "Denmark_77" 79 "Denmark_79" 80 "Denmark_81" 81 "Denmark_84" 82 "Denmark_87" 83 "Denmark_88" 84 "Denmark_90" 85 "Denmark_94" 86 "Denmark_98" 87 "Denmark_01" 88 "Denmark_05" 89 "Denmark_07" 90 "Denmark_11" 91 "Denmark_15"     ///                              
92 "Finland_51" 93 "Finland_54"  94  "Finland_58" 95 "Finland_62" 96 "Finland_66" 97 "Finland_70" 98 "Finland_72" 99 "Finland_75" 100 "Finland_79" 101 "Finland_83" 102 "Finland_87" 103 "Finland_91" 104  "Finland_95" 105 "Finland_99" 106 "Finland_03" 107 "Finland_07" 108 "Finland_11" 109 "Finland_15" ///
110 "France_51" 111  "France_56" 112 "France_58" 113 "France_62" 114 "France_67" 115 "France_68" 116 "France_73" 117 "France_78" 118 "France_81" 119 "France_86" 120 "France_88" 121 "France_93" 122 "France_97" 123 "France_02" 124 "France_07" 125 "France_12" ///
126 "Germany_53" 127 "Germany_57" 128 "Germany_61" 129 "Germany_65" 130 "Germany_69" 131 "Germany_72" 132 "Germany_76" 133 "Germany_80" 134 "Germany_83" 135 "Germany_87" 136 "Germany_90" 137 "Germany_94" 138 "Germany_98" 139 "Germany_02" 140 "Germany_05" 141 "Germany_09" 142 "Germany_13" ///
143 "Greece_74" 144 "Greece_77" 145 "Greece_81" 146 "Greece_85" 147 "Greece_89a" 148 "Greece_89b" 149 "Greece_90" 150  "Greece_93" 151  "Greece_96" 152  "Greece_00" 153 "Greece_04" 154  "Greece_07" 155  "Greece_09" 156 "Greece_12a" 157 "Greece_12b" 158 "Greece_15a" 159 "Greece_15b" /// 
160 "Iceland_53" 161  "Iceland_56" 162  "Iceland_59a" 163  "Iceland_59b" 164  "Iceland_63" 165  "Iceland_67" 166 "Iceland_71" 167 "Iceland_74" 168 "Iceland_78" 169  "Iceland_79" 170   "Iceland_83" 171 "Iceland_87" 172 "Iceland_91" 173  "Iceland_95" 174 "Iceland_99" 175  "Iceland_03" 176 "Iceland_07" 177 "Iceland_09" 178 "Iceland_13" 179 "Iceland_16" ///
180 "Ireland_51" 181 "Ireland_54" 182 "Ireland_57" 183 "Ireland_61" 184 "Ireland_65" 185 "Ireland_69" 186 "Ireland_73" 187  "Ireland_77" 188  "Ireland_81" 189   "Ireland_82a" 190  "Ireland_82b" 191  "Ireland_87" 192  "Ireland_89" 193  "Ireland_92" 194 "Ireland_97" 195 "Ireland_02" 196 "Ireland_07" 197  "Ireland_11" 198 "Ireland_16" ///
199 "Italy_53" 200  "Italy_58" 201  "Italy_63" 202 "Italy_68" 203 "Italy_72" 204  "Italy_76" 205 "Italy_79" 206 "Italy 83" 207 "Italy_87" 208 "Italy_92" 209  "Italy_94" 210 "Italy_96" 211 "Italy_01" 212 "Italy_06" 213 "Italy_08" 214 "Italy_13" ///
215 "Lux_51" 216 "Lux_54" 217  "Lux_59" 218 "Lux_64" 219 "Lux_68" 220 "Lux_74" 221 "Lux_79" 222 "Lux_84" 223  "Lux_89" 224  "Lux_94" 225  "Lux_99" 226  "Lux_04" 227  "Lux_09" 228 "Lux_13" ///
229 "Malta_66" 230 "Malta_71" 231 "Malta_76" 232 "Malta_81" 233 "Malta_87" 234 "Malta_92" 235 "Malta_96" 236 "Malta_98" 237 "Malta_03" 238 "Malta_08" 239 "Malta_13" ///
240 "Neth_52" 241 "Neth_56" 242  "Neth_59" 243  "Neth_63" 244  "Neth_67" 245  "Neth_71" 246  "Neth_72" 247 "Neth_77" 248 "Neth_81" 249  "Neth_82" 250 "Neth_86" 251 "Neth_89" 252 "Neth_94" 253 "Neth_98" 254 "Neth_02" 255 "Neth_03" 256 "Neth_06" 257 "Neth_10" 258 "Neth_12" ///
259 "NZ_51" 260 "NZ_54" 261 "NZ_57" 262  "NZ_60" 263 "NZ_63" 264 "NZ_66" 265 "NZ_69" 266 "NZ_72" 267 "NZ_75" 268 "NZ_78" 269 "NZ_81" 270 "NZ_84" 271 "NZ_87" 272 "NZ_90" 273 "NZ_93" 274 "NZ_96" 275 "NZ_99" 276 "NZ_02" 277 "NZ_05" 278 "NZ_08" 279 "NZ_11" 280 "NZ_14" ///
281 "Norway_53" 282 "Norway_57" 283 "Norway_61" 284 "Norway_65" 285 "Norway_69" 286 "Norway_73" 287 "Norway_77" 288 "Norway_81" 289 "Norway_85" 290  "Norway_89" 291 "Norway_93" 292 "Norway_97" 293 "Norway_01" 294 "Norway_05" 295 "Norway_09" 296 "Norway_13" ///
297 "Portugal_76" 298 "Portugal_79" 299 "Portugal_80" 300  "Portugal_83" 301 "Portugal_85" 302 "Portugal_87" 303 "Portugal_91" 304 "Portugal_95" 305 "Portugal_99" 306  "Portugal_02" 307 "Portugal_05" 308  "Portugal_09" 309  "Portugal_11" 310 "Portugal_15" ///
311 "Spain_77" 312  "Spain_79" 313 "Spain_82" 314 "Spain_86" 315  "Spain_89" 316  "Spain_93" 317  "Spain_96" 318  "Spain_00" 319 "Spain_04" 320 "Spain_08" 321  "Spain_11" 322  "Spain_15"  323 "Spain_16" ///
324 "Sweden_52" 325 "Sweden_56" 326  "Sweden_58" 327 "Sweden_60" 328 "Sweden_64" 329  "Sweden_68" 330 "Sweden_70" 331  "Sweden_73" 332 "Sweden_76" 333 "Sweden_79" 334 "Sweden_82" 335  "Sweden_85" 336 "Sweden_88" 337 "Sweden_91" 338  "Sweden_94" 339  "Sweden_98" 340  "Sweden_02" 341  "Sweden_06" 342  "Sweden_10" 343 "Sweden_14" ///
344 "Switz_51" 345  "Switz_55" 346 "Switz_59" 347 "Switz_63" 348 "Switz_67" 349 "Switz_71" 350 "Switz_75" 351 "Switz_79" 352 "Switz_83" 353 "Switz_87" 354 "Switz_91" 355  "Switz_95" 356 "Switz_99" 357 "Switz_03" 358 "Switz_07" 359 "Switz_11" 360 "Switz_15" ///
361 "UK_50" 362 "UK_51" 363 "UK_55" 364  "UK_59" 365 "UK_64" 366 "UK_66" 367  "UK_70" 368  "UK_74a" 369  "UK_74b" 370  "UK_79" 371 "UK_83" 372 "UK_87" 373 "UK_92" 374 "UK_97" 375 "UK_01" 376 "UK_05" 377  "UK_10" 378 "UK_15" ///
379 "Flanders_50" 380 "Flanders_54" 381 "Flanders_58" 382 "Flanders_61" 383 "Flanders_65" 384 "Flanders_68" 385 "Flanders_71" 386 "Flanders_74" 387 "Flanders_77" 388 "Flanders_78" 389 "Flanders_81" 390 "Flanders_85" 391 "Flanders_87" 392 "Flanders_91" 393 "Flanders_95" 394 "Flanders_99" 395 "Flanders_03" 396 "Flanders_07" 397 "Flanders_10" 398 "Flanders_14" ///
399 "Wallonia_50" 400 "Wallonia_54" 401 "Wallonia_58" 402 "Wallonia_61" 403 "Wallonia_65" 404 "Wallonia_68" 405 "Wallonia_71" 406 "Wallonia_74" 407 "Wallonia_77" 408 "Wallonia_78" 409 "Wallonia_81" 410 "Wallonia_85" 411 "Wallonia_87" 412 "Wallonia_91" 413 "Wallonia_95" 414 "Wallonia_99" 415 "Wallonia_03" 416 "Wallonia_07" 417 "Wallonia_10" 418 "Wallonia_14" 

label value countryelection countryelection

gen FEcountry =.
label variable FEcountry "Country Fixed-Effect"
label define FEcountry 1 "Australia" 2 "Austria" 3 "Belgium (Flanders)" 4 "Belgium (Wallonia)" 5 "Canada" 6 "Denmark" 7 "Finland" 8 "France" 9 "Germany" 10 "Greece" ///
                      11 "Iceland"  12 "Ireland" 13 "Italy" 14 "Luxembourg" 15 "Malta" 16 "Netherlands" 17 "New Zealand" 18 "Norway" 19 "Portugal" ///
					  20 "Spain"    21 "Sweden"  22 "Switzerland"  23 "United Kingdom" 
		

		
label value FEcountry FEcountry

replace FEcountry = 1  if inrange(countryelection,1,26)
replace FEcountry = 2  if inrange(countryelection,27,45)
replace FEcountry = 3  if inrange(countryelection,379,398)
replace FEcountry = 4  if inrange(countryelection,399,418)
replace FEcountry = 5  if inrange(countryelection,46,66)
replace FEcountry = 6  if inrange(countryelection,67,91)
replace FEcountry = 7  if inrange(countryelection,92,109)
replace FEcountry = 8  if inrange(countryelection,110,125)
replace FEcountry = 9  if inrange(countryelection,126,142)
replace FEcountry = 10 if inrange(countryelection,143,159)
replace FEcountry = 11 if inrange(countryelection,160,179)
replace FEcountry = 12 if inrange(countryelection,180,198)
replace FEcountry = 13 if inrange(countryelection,199,214)
replace FEcountry = 14 if inrange(countryelection,215,228)
replace FEcountry = 15 if inrange(countryelection,229,239)
replace FEcountry = 16 if inrange(countryelection,240,258)
replace FEcountry = 17 if inrange(countryelection,259,280)
replace FEcountry = 18 if inrange(countryelection,281,296)
replace FEcountry = 19 if inrange(countryelection,297,310)
replace FEcountry = 20 if inrange(countryelection,311,323)
replace FEcountry = 21 if inrange(countryelection,324,343)
replace FEcountry = 22 if inrange(countryelection,344,360)
replace FEcountry = 23 if inrange(countryelection,361,378)

gen string_date =.    
tostring string_date, replace
label variable string_date "Election Date (String)"


* Note: To avoid "repeated time values in sample, 9 obvs (01jun1958, 25oct1959, 18nov1962, 30nov1963,
*       26nov1966, 02dec1979, 05oct1980, 18jun1989, 13jun1999, 10jun2007, 27sep2009) had their dates
*       pushed forward a day, so as not to clash with another obv ... Wallonia region results always set 1 day after Flanders" (see ASP_chpt_1)

replace string_date = "Apr 28, 1951"   if countryelection == 1
replace string_date = "May 29, 1954"   if countryelection == 2
replace string_date = "Dec 10, 1955"   if countryelection == 3
replace string_date = "Nov 22, 1958"   if countryelection == 4
replace string_date = "Dec  9, 1961"   if countryelection == 5
replace string_date = "Dec  1, 1963"   if countryelection == 6
replace string_date = "Nov 27, 1966"   if countryelection == 7
replace string_date = "Oct 25, 1969"   if countryelection == 8
replace string_date = "Dec  2, 1972"   if countryelection == 9
replace string_date = "May 18, 1974"   if countryelection == 10
replace string_date = "Dec 13, 1975"   if countryelection == 11
replace string_date = "Dec 10, 1977"   if countryelection == 12
replace string_date = "Oct 18, 1980"   if countryelection == 13
replace string_date = "Mar  5, 1983"   if countryelection == 14
replace string_date = "Dec  1, 1984"   if countryelection == 15
replace string_date = "Jul 11, 1987"   if countryelection == 16
replace string_date = "Mar 24, 1990"   if countryelection == 17
replace string_date = "Mar 13, 1993"   if countryelection == 18
replace string_date = "Mar  2, 1996"   if countryelection == 19
replace string_date = "Oct  3, 1998"   if countryelection == 20
replace string_date = "Nov 10, 2001"   if countryelection == 21
replace string_date = "Oct  9, 2004"   if countryelection == 22
replace string_date = "Nov 24, 2007"   if countryelection == 23
replace string_date = "Aug 21, 2010"   if countryelection == 24
replace string_date = "Sep  7, 2013"   if countryelection == 25
replace string_date = "Jul  2, 2016"   if countryelection == 26

replace string_date = "Feb 22, 1953"   if countryelection == 27
replace string_date = "May 13, 1956"   if countryelection == 28
replace string_date = "May 10, 1959"   if countryelection == 29
replace string_date = "Nov 19, 1962"   if countryelection == 30
replace string_date = "Mar  6, 1966"   if countryelection == 31
replace string_date = "Mar  1, 1970"   if countryelection == 32
replace string_date = "Oct 10, 1971"   if countryelection == 33
replace string_date = "Oct  5, 1975"   if countryelection == 34
replace string_date = "May  6, 1979"   if countryelection == 35
replace string_date = "Apr 24, 1983"   if countryelection == 36
replace string_date = "Nov 23, 1986"   if countryelection == 37
replace string_date = "Oct  7, 1990"   if countryelection == 38
replace string_date = "Oct  9, 1994"   if countryelection == 39
replace string_date = "Dec 17, 1995"   if countryelection == 40
replace string_date = "Oct  3, 1999"   if countryelection == 41
replace string_date = "Nov 24, 2002"   if countryelection == 42
replace string_date = "Oct  1, 2006"   if countryelection == 43  
replace string_date = "Sep 28, 2008"   if countryelection == 44  
replace string_date = "Sep 29, 2013"   if countryelection == 45  

replace string_date = "Aug 10, 1953"   if countryelection == 46
replace string_date = "Jun 10, 1957"   if countryelection == 47
replace string_date = "Mar 31, 1958"   if countryelection == 48                                
replace string_date = "Jun 18, 1962"   if countryelection == 49                                
replace string_date = "Apr  8, 1963"   if countryelection == 50                               
replace string_date = "Nov  8, 1965"   if countryelection == 51   
replace string_date = "Jun 25, 1968"   if countryelection == 52   								
replace string_date = "Oct 30, 1972"   if countryelection == 53   								
replace string_date = "Jul  8, 1974"   if countryelection == 54   								
replace string_date = "May 22, 1979"   if countryelection == 55   								
replace string_date = "Feb 18, 1980"   if countryelection == 56   								
replace string_date = "Sep  4, 1984"   if countryelection == 57   								
replace string_date = "Nov 21, 1988"   if countryelection == 58   								
replace string_date = "Oct 25, 1993"   if countryelection == 59   								
replace string_date = "Jun  2, 1997"   if countryelection == 60   								
replace string_date = "Nov 27, 2000"   if countryelection == 61   								
replace string_date = "Jun 28, 2004"   if countryelection == 62   								
replace string_date = "Jan 23, 2006"   if countryelection == 63   								
replace string_date = "Oct 14, 2008"   if countryelection == 64   								
replace string_date = "May  2, 2011"   if countryelection == 65   								
replace string_date = "Oct 19, 2015"   if countryelection == 66  								
								 								
replace string_date = "Sep  5, 1950"   if countryelection == 67								
replace string_date = "Apr 21, 1953"   if countryelection == 68 								
replace string_date = "Sep 22, 1953"   if countryelection == 69 								
replace string_date = "May 14, 1957"   if countryelection == 70 								
replace string_date = "Nov 15, 1960"   if countryelection == 71 								
replace string_date = "Sep 22, 1964"   if countryelection == 72 								
replace string_date = "Nov 22, 1966"   if countryelection == 73 								
replace string_date = "Jan 23, 1968"   if countryelection == 74 								
replace string_date = "Sep 21, 1971"   if countryelection == 75 								
replace string_date = "Dec  4, 1973"   if countryelection == 76 								
replace string_date = "Jan  9, 1975"   if countryelection == 77 								
replace string_date = "Feb 15, 1977"   if countryelection == 78 								
replace string_date = "Oct 23, 1979"   if countryelection == 79 								
replace string_date = "Dec  8, 1981"   if countryelection == 80 								
replace string_date = "Jan 10, 1984"   if countryelection == 81 								
replace string_date = "Sep  8, 1987"   if countryelection == 82 								
replace string_date = "May 10, 1988"   if countryelection == 83 								
replace string_date = "Dec 12, 1990"   if countryelection == 84 								
replace string_date = "Sep 21, 1994"   if countryelection == 85 								
replace string_date = "Mar 11, 1998"   if countryelection == 86 								
replace string_date = "Nov 20, 2001"   if countryelection == 87 								
replace string_date = "Feb  8, 2005"   if countryelection == 88 								
replace string_date = "Nov 13, 2007"   if countryelection == 89								
replace string_date = "Sep 15, 2011"   if countryelection == 90 								
replace string_date = "Jun 18, 2015"   if countryelection == 91 								
																
replace string_date = "Jul  1, 1951"   if countryelection == 92							
replace string_date = "Mar  7, 1954"   if countryelection == 93 								
replace string_date = "Jul  6, 1958"   if countryelection == 94 								
replace string_date = "Feb  4, 1962"   if countryelection == 95 								
replace string_date = "Mar 20, 1966"   if countryelection == 96 								
replace string_date = "Mar 15, 1970"   if countryelection == 97								
replace string_date = "Jan  2, 1972"   if countryelection == 98 								
replace string_date = "Sep 21, 1975"   if countryelection == 99 
replace string_date = "Mar 18, 1979"   if countryelection == 100 
replace string_date = "Mar 20, 1983"   if countryelection == 101
replace string_date = "Mar 15, 1987"   if countryelection == 102 
replace string_date = "Mar 17, 1991"   if countryelection == 103 
replace string_date = "Mar 19, 1995"   if countryelection == 104 
replace string_date = "Mar 21, 1999"   if countryelection == 105
replace string_date = "Mar 16, 2003"   if countryelection == 106 
replace string_date = "Mar 18, 2007"   if countryelection == 107
replace string_date = "Apr 17, 2011"   if countryelection == 108 
replace string_date = "Apr 19, 2015"   if countryelection == 109 

replace string_date = "Jun 17, 1951"   if countryelection == 110
replace string_date = "Jan  2, 1956"   if countryelection == 111
replace string_date = "Nov 23, 1958"   if countryelection == 112
replace string_date = "Nov 18, 1962"   if countryelection == 113
replace string_date = "Mar  5, 1967"   if countryelection == 114
replace string_date = "Jun 23, 1968"   if countryelection == 115
replace string_date = "Mar  4, 1973"   if countryelection == 116
replace string_date = "Mar 12, 1978"   if countryelection == 117
replace string_date = "Jun 14, 1981"   if countryelection == 118
replace string_date = "Mar 16, 1986"   if countryelection == 119
replace string_date = "Jun  5, 1988"   if countryelection == 120
replace string_date = "Mar 21, 1993"   if countryelection == 121
replace string_date = "May 25, 1997"   if countryelection == 122
replace string_date = "Jun  9, 2002"   if countryelection == 123
replace string_date = "Jun 10, 2007"   if countryelection == 124
replace string_date = "Jun 10, 2012"   if countryelection == 125

replace string_date = "Sep  6, 1953"   if countryelection == 126
replace string_date = "Sep 15, 1957"   if countryelection == 127
replace string_date = "Sep 17, 1961"   if countryelection == 128
replace string_date = "Sep 19, 1965"   if countryelection == 129
replace string_date = "Sep 28, 1969"   if countryelection == 130
replace string_date = "Nov 19, 1972"   if countryelection == 131
replace string_date = "Oct  3, 1976"   if countryelection == 132
replace string_date = "Oct  6, 1980"   if countryelection == 133
replace string_date = "Mar  6, 1983"   if countryelection == 134
replace string_date = "Jan 25, 1987"   if countryelection == 135
replace string_date = "Dec  2, 1990"   if countryelection == 136
replace string_date = "Oct 16, 1994"   if countryelection == 137
replace string_date = "Sep 27, 1998"   if countryelection == 138
replace string_date = "Sep 22, 2002"   if countryelection == 139
replace string_date = "Sep 18, 2005"   if countryelection == 140
replace string_date = "Sep 28, 2009"   if countryelection == 141
replace string_date = "Sep 22, 2013"   if countryelection == 142

replace string_date = "Nov 17, 1974"   if countryelection == 143
replace string_date = "Nov 20, 1977"   if countryelection == 144
replace string_date = "Oct 18, 1981"   if countryelection == 145
replace string_date = "Jun  2, 1985"   if countryelection == 146
replace string_date = "Jun 19, 1989"   if countryelection == 147
replace string_date = "Nov  5, 1989"   if countryelection == 148
replace string_date = "Apr  8, 1990"   if countryelection == 149
replace string_date = "Oct 10, 1993"   if countryelection == 150
replace string_date = "Sep 22, 1996"   if countryelection == 151
replace string_date = "Apr  9, 2000"   if countryelection == 152
replace string_date = "Mar  7, 2004"   if countryelection == 153
replace string_date = "Sep 16, 2007"   if countryelection == 154
replace string_date = "Oct  4, 2009"   if countryelection == 155
replace string_date = "May  6, 2012"   if countryelection == 156
replace string_date = "Jun 17, 2012"   if countryelection == 157
replace string_date = "Jan 25, 2015"   if countryelection == 158
replace string_date = "Sep 20, 2015"   if countryelection == 159

replace string_date = "Jun 28, 1953"   if countryelection == 160
replace string_date = "Jun 24, 1956"   if countryelection == 161
replace string_date = "Jun 28, 1959"   if countryelection == 162
replace string_date = "Oct 26, 1959"   if countryelection == 163
replace string_date = "Jun  9, 1963"   if countryelection == 164
replace string_date = "Jun 11, 1967"   if countryelection == 165
replace string_date = "Jun 13, 1971"   if countryelection == 166
replace string_date = "Jun 30, 1974"   if countryelection == 167
replace string_date = "Jun 25, 1978"   if countryelection == 168
replace string_date = "Dec  3, 1979"   if countryelection == 169
replace string_date = "Apr 23, 1983"   if countryelection == 170
replace string_date = "Apr 25, 1987"   if countryelection == 171
replace string_date = "Apr 20, 1991"   if countryelection == 172
replace string_date = "Apr  8, 1995"   if countryelection == 173
replace string_date = "May  8, 1999"   if countryelection == 174
replace string_date = "May 10, 2003"   if countryelection == 175
replace string_date = "May 12, 2007"   if countryelection == 176
replace string_date = "Apr 25, 2009"   if countryelection == 177
replace string_date = "Apr 27, 2013"   if countryelection == 178
replace string_date = "Oct 29, 2016"   if countryelection == 179

replace string_date = "May 30, 1951"   if countryelection == 180
replace string_date = "May 18, 1954"   if countryelection == 181
replace string_date = "Mar  5, 1957"   if countryelection == 182
replace string_date = "Oct  4, 1961"   if countryelection == 183
replace string_date = "Apr  7, 1965"   if countryelection == 184
replace string_date = "Jun 18, 1969"   if countryelection == 185
replace string_date = "Feb 28, 1973"   if countryelection == 186
replace string_date = "Jun 16, 1977"   if countryelection == 187
replace string_date = "Jun 11, 1981"   if countryelection == 188
replace string_date = "Feb 18, 1982"   if countryelection == 189
replace string_date = "Nov 24, 1982"   if countryelection == 190
replace string_date = "Feb 17, 1987"   if countryelection == 191
replace string_date = "Jun 15, 1989"   if countryelection == 192
replace string_date = "Nov 25, 1992"   if countryelection == 193
replace string_date = "Jun  6, 1997"   if countryelection == 194
replace string_date = "May 18, 2002"   if countryelection == 195
replace string_date = "May 24, 2007"   if countryelection == 196
replace string_date = "Feb 25, 2011"   if countryelection == 197
replace string_date = "Feb 16, 2016"   if countryelection == 198

replace string_date = "Jun  7, 1953"   if countryelection == 199
replace string_date = "May 25, 1958"   if countryelection == 200
replace string_date = "Apr 28, 1963"   if countryelection == 201
replace string_date = "May 19, 1968"   if countryelection == 202
replace string_date = "May  7, 1972"   if countryelection == 203
replace string_date = "Jun 20, 1976"   if countryelection == 204
replace string_date = "Jun  3, 1979"   if countryelection == 205
replace string_date = "Jun 26, 1983"   if countryelection == 206
replace string_date = "Jun 14, 1987"   if countryelection == 207
replace string_date = "Apr  5, 1992"   if countryelection == 208
replace string_date = "Mar 27, 1994"   if countryelection == 209
replace string_date = "Apr 21, 1996"   if countryelection == 210
replace string_date = "May 13, 2001"   if countryelection == 211
replace string_date = "Apr  9, 2006"   if countryelection == 212
replace string_date = "Apr 13, 2008"   if countryelection == 213
replace string_date = "Feb 24, 2013"   if countryelection == 214

replace string_date = "Jun  3, 1951"   if countryelection == 215
replace string_date = "May 30, 1954"   if countryelection == 216
replace string_date = "Feb  1, 1959"   if countryelection == 217
replace string_date = "Jun  7, 1964"   if countryelection == 218
replace string_date = "Dec 15, 1968"   if countryelection == 219
replace string_date = "May 26, 1974"   if countryelection == 220
replace string_date = "Jun 10, 1979"   if countryelection == 221
replace string_date = "Jun 17, 1984"   if countryelection == 222
replace string_date = "Jun 18, 1989"   if countryelection == 223
replace string_date = "Jun 12, 1994"   if countryelection == 224
replace string_date = "Jun 13, 1999"   if countryelection == 225
replace string_date = "Jun 13, 2004"   if countryelection == 226
replace string_date = "Jun  7, 2009"   if countryelection == 227
replace string_date = "Oct 20, 2013"   if countryelection == 228

replace string_date = "Mar 28, 1966"   if countryelection == 229
replace string_date = "Jun 12, 1971"   if countryelection == 230
replace string_date = "Apr 17, 1976"   if countryelection == 231
replace string_date = "Dec 12, 1981"   if countryelection == 232
replace string_date = "May  9, 1987"   if countryelection == 233
replace string_date = "Feb 22, 1992"   if countryelection == 234
replace string_date = "Oct 26, 1996"   if countryelection == 235
replace string_date = "Sep  5, 1998"   if countryelection == 236
replace string_date = "Apr 12, 2003"   if countryelection == 237
replace string_date = "Mar  8, 2008"   if countryelection == 238
replace string_date = "Mar  9, 2013"   if countryelection == 239

replace string_date = "Jun 25, 1952"   if countryelection == 240
replace string_date = "Jun 13, 1956"   if countryelection == 241
replace string_date = "Mar 12, 1959"   if countryelection == 242
replace string_date = "May 15, 1963"   if countryelection == 243
replace string_date = "Feb 15, 1967"   if countryelection == 244
replace string_date = "Apr 28, 1971"   if countryelection == 245
replace string_date = "Nov 29, 1972"   if countryelection == 246
replace string_date = "May 25, 1977"   if countryelection == 247
replace string_date = "May 26, 1981"   if countryelection == 248
replace string_date = "Sep  8, 1982"   if countryelection == 249
replace string_date = "May 21, 1986"   if countryelection == 250
replace string_date = "Sep  6, 1989"   if countryelection == 251
replace string_date = "May  3, 1994"   if countryelection == 252
replace string_date = "May  6, 1998"   if countryelection == 253
replace string_date = "May 15, 2002"   if countryelection == 254
replace string_date = "Jan 22, 2003"   if countryelection == 255
replace string_date = "Nov 22, 2006"   if countryelection == 256
replace string_date = "Jun  9, 2010"   if countryelection == 257
replace string_date = "Sep 12, 2012"   if countryelection == 258

replace string_date = "Sep  1, 1951"   if countryelection == 259
replace string_date = "Nov 13, 1954"   if countryelection == 260
replace string_date = "Nov 30, 1957"   if countryelection == 261
replace string_date = "Nov 27, 1960"   if countryelection == 262
replace string_date = "Nov 30, 1963"   if countryelection == 263
replace string_date = "Nov 26, 1966"   if countryelection == 264
replace string_date = "Nov 29, 1969"   if countryelection == 265
replace string_date = "Nov 25, 1972"   if countryelection == 266
replace string_date = "Nov 29, 1975"   if countryelection == 267
replace string_date = "Nov 25, 1978"   if countryelection == 268
replace string_date = "Nov 28, 1981"   if countryelection == 269
replace string_date = "Jul 14, 1984"   if countryelection == 270
replace string_date = "Aug 15, 1987"   if countryelection == 271
replace string_date = "Oct 27, 1990"   if countryelection == 272
replace string_date = "Nov  6, 1993"   if countryelection == 273
replace string_date = "Oct 12, 1996"   if countryelection == 274
replace string_date = "Nov 27, 1999"   if countryelection == 275
replace string_date = "Jul 27, 2002"   if countryelection == 276
replace string_date = "Sep 17, 2005"   if countryelection == 277
replace string_date = "Nov  8, 2008"   if countryelection == 278
replace string_date = "Nov 26, 2011"   if countryelection == 279
replace string_date = "Sep 20, 2014"   if countryelection == 280

replace string_date = "Oct 12, 1953"   if countryelection == 281
replace string_date = "Oct  7, 1957"   if countryelection == 282
replace string_date = "Oct  7, 1961"   if countryelection == 283
replace string_date = "Sep 12, 1965"   if countryelection == 284
replace string_date = "Sep  7, 1969"   if countryelection == 285
replace string_date = "Sep  9, 1973"   if countryelection == 286
replace string_date = "Sep 11, 1977"   if countryelection == 287
replace string_date = "Sep 13, 1981"   if countryelection == 288
replace string_date = "Sep  8, 1985"   if countryelection == 289
replace string_date = "Sep 10, 1989"   if countryelection == 290
replace string_date = "Sep 12, 1993"   if countryelection == 291
replace string_date = "Sep 15, 1997"   if countryelection == 292
replace string_date = "Sep 10, 2001"   if countryelection == 293
replace string_date = "Sep 12, 2005"   if countryelection == 294
replace string_date = "Sep 14, 2009"   if countryelection == 295
replace string_date = "Sep  9, 2013"   if countryelection == 296

replace string_date = "Apr 25, 1976"   if countryelection == 297
replace string_date = "Dec  2, 1979"   if countryelection == 298
replace string_date = "Oct  5, 1980"   if countryelection == 299
replace string_date = "Apr 25, 1983"   if countryelection == 300
replace string_date = "Oct  6, 1985"   if countryelection == 301
replace string_date = "Jul 19, 1987"   if countryelection == 302
replace string_date = "Oct  6, 1991"   if countryelection == 303
replace string_date = "Oct  1, 1995"   if countryelection == 304
replace string_date = "Oct 10, 1999"   if countryelection == 305
replace string_date = "Mar 17, 2002"   if countryelection == 306
replace string_date = "Feb 20, 2005"   if countryelection == 307
replace string_date = "Sep 27, 2009"   if countryelection == 308
replace string_date = "Jun  5, 2011"   if countryelection == 309
replace string_date = "Oct  4, 2015"   if countryelection == 310

replace string_date = "Jun 15, 1977"   if countryelection == 311
replace string_date = "Mar  1, 1979"   if countryelection == 312
replace string_date = "Oct 28, 1982"   if countryelection == 313
replace string_date = "Jun 22, 1986"   if countryelection == 314
replace string_date = "Oct 29, 1989"   if countryelection == 315
replace string_date = "Jun  6, 1993"   if countryelection == 316
replace string_date = "Mar  3, 1996"   if countryelection == 317
replace string_date = "Mar 12, 2000"   if countryelection == 318
replace string_date = "Mar  4, 2004"   if countryelection == 319
replace string_date = "Mar  9, 2008"   if countryelection == 320
replace string_date = "Nov 20, 2011"   if countryelection == 321
replace string_date = "Dec 20, 2015"   if countryelection == 322
replace string_date = "Jun 26, 2016"   if countryelection == 323

replace string_date = "Sep 21, 1952"   if countryelection == 324
replace string_date = "Sep 16, 1956"   if countryelection == 325
replace string_date = "Jun  1, 1958"   if countryelection == 326
replace string_date = "Sep 18, 1960"   if countryelection == 327
replace string_date = "Sep 20, 1964"   if countryelection == 328
replace string_date = "Sep 15, 1968"   if countryelection == 329
replace string_date = "Sep 20, 1970"   if countryelection == 330
replace string_date = "Sep 16, 1973"   if countryelection == 331
replace string_date = "Sep 19, 1976"   if countryelection == 332
replace string_date = "Sep 16, 1979"   if countryelection == 333
replace string_date = "Sep 19, 1982"   if countryelection == 334
replace string_date = "Sep 15, 1985"   if countryelection == 335
replace string_date = "Sep 18, 1988"   if countryelection == 336
replace string_date = "Sep 15, 1991"   if countryelection == 337
replace string_date = "Sep 18, 1994"   if countryelection == 338
replace string_date = "Sep 20, 1998"   if countryelection == 339
replace string_date = "Sep 15, 2002"   if countryelection == 340
replace string_date = "Sep 17, 2006"   if countryelection == 341
replace string_date = "Sep 19, 2010"   if countryelection == 342
replace string_date = "Sep 14, 2014"   if countryelection == 343

replace string_date = "Oct 28, 1951"   if countryelection == 344
replace string_date = "Oct 30, 1955"   if countryelection == 345
replace string_date = "Oct 25, 1959"   if countryelection == 346
replace string_date = "Oct 27, 1963"   if countryelection == 347
replace string_date = "Oct 29, 1967"   if countryelection == 348
replace string_date = "Oct 31, 1971"   if countryelection == 349
replace string_date = "Oct 26, 1975"   if countryelection == 350
replace string_date = "Oct 21, 1979"   if countryelection == 351
replace string_date = "Oct 23, 1983"   if countryelection == 352
replace string_date = "Oct 18, 1987"   if countryelection == 353
replace string_date = "Oct 20, 1991"   if countryelection == 354
replace string_date = "Oct 29, 1995"   if countryelection == 355
replace string_date = "Oct 24, 1999"   if countryelection == 356
replace string_date = "Oct 19, 2003"   if countryelection == 357
replace string_date = "Oct 21, 2007"   if countryelection == 358
replace string_date = "Oct 23, 2011"   if countryelection == 359
replace string_date = "Oct 18, 2015"   if countryelection == 360

replace string_date = "Feb 23, 1950"   if countryelection == 361
replace string_date = "Oct 25, 1951"   if countryelection == 362
replace string_date = "May 26, 1955"   if countryelection == 363
replace string_date = "Oct  8, 1959"   if countryelection == 364
replace string_date = "Oct 15, 1964"   if countryelection == 365
replace string_date = "Mar 31, 1966"   if countryelection == 366
replace string_date = "Jun 18, 1970"   if countryelection == 367
replace string_date = "Feb 28, 1974"   if countryelection == 368
replace string_date = "Oct 10, 1974"   if countryelection == 369
replace string_date = "May  3, 1979"   if countryelection == 370
replace string_date = "Jun  9, 1983"   if countryelection == 371
replace string_date = "Jun 11, 1987"   if countryelection == 372
replace string_date = "Apr  9, 1992"   if countryelection == 373
replace string_date = "May  1, 1997"   if countryelection == 374
replace string_date = "Jun  7, 2001"   if countryelection == 375
replace string_date = "May  5, 2005"   if countryelection == 376
replace string_date = "May  6, 2010"   if countryelection == 377
replace string_date = "May  7, 2015"   if countryelection == 378

replace string_date = "Jun  4, 1950"   if countryelection == 379
replace string_date = "Apr 11, 1954"   if countryelection == 380
replace string_date = "Jun  2, 1958"   if countryelection == 381
replace string_date = "Mar 26, 1961"   if countryelection == 382
replace string_date = "May 23, 1965"   if countryelection == 383
replace string_date = "Mar 31, 1968"   if countryelection == 384
replace string_date = "Nov  7, 1971"   if countryelection == 385
replace string_date = "Mar 10, 1974"   if countryelection == 386
replace string_date = "Apr 17, 1977"   if countryelection == 387
replace string_date = "Dec 17, 1978"   if countryelection == 388
replace string_date = "Nov  8, 1981"   if countryelection == 389
replace string_date = "Oct 13, 1985"   if countryelection == 390
replace string_date = "Dec 13, 1987"   if countryelection == 391
replace string_date = "Nov 24, 1991"   if countryelection == 392
replace string_date = "May 21, 1995"   if countryelection == 393
replace string_date = "Jun 14, 1999"   if countryelection == 394
replace string_date = "May 18, 2003"   if countryelection == 395
replace string_date = "Jun 11, 2007"   if countryelection == 396
replace string_date = "Jun 13, 2010"   if countryelection == 397
replace string_date = "May 25, 2014"   if countryelection == 398

replace string_date = "Jun  5, 1950"   if countryelection == 399
replace string_date = "Apr 12, 1954"   if countryelection == 400
replace string_date = "Jun  3, 1958"   if countryelection == 401
replace string_date = "Mar 27, 1961"   if countryelection == 402
replace string_date = "May 24, 1965"   if countryelection == 403
replace string_date = "Apr  1, 1968"   if countryelection == 404
replace string_date = "Nov  8, 1971"   if countryelection == 405
replace string_date = "Mar 11, 1974"   if countryelection == 406
replace string_date = "Apr 18, 1977"   if countryelection == 407
replace string_date = "Dec 18, 1978"   if countryelection == 408
replace string_date = "Nov  9, 1981"   if countryelection == 409
replace string_date = "Oct 14, 1985"   if countryelection == 410
replace string_date = "Dec 14, 1987"   if countryelection == 411
replace string_date = "Nov 25, 1991"   if countryelection == 412
replace string_date = "May 22, 1995"   if countryelection == 413
replace string_date = "Jun 15, 1999"   if countryelection == 414
replace string_date = "May 19, 2003"   if countryelection == 415
replace string_date = "Jun 12, 2007"   if countryelection == 416
replace string_date = "Jun 14, 2010"   if countryelection == 417
replace string_date = "May 26, 2014"   if countryelection == 418

generate edate=date(string_date,"MDY")
format edate %d
label variable edate "Election Date (Numeric)"

generate post_auth_election = 1 if inlist(countryelection, 143, 144, 145, 297, 298, 299, 300, 301, 311, 312, 313)
label variable post_auth_election "Dummy for Elections Following Authoritarian Intervals of 6+ Years (pre-EEC)"

************************************************************ CLASSIFICATION OF PARTIES ************************************************************


gen string_PSparties = .
label variable string_PSparties "List of Pro-System Parties (Vote Share, type)"

gen voteper_PSparties = .
label variable voteper_PSparties "Total Vote Share of Pro-System Parties (% Valid Votes)"

gen string_CPparties =.
label variable string_CPparties "List of Complementary Parties (Vote Share, type)"

gen voteper_CPparties = .
label variable voteper_CPparties "Total Vote Share of Complementary Parties (% Valid Votes)"

gen string_SCparties =.
label variable string_SCparties "List of System-Critical Parties (Vote Share, type)"

gen voteper_SCparties = .
label variable voteper_SCparties "Total Vote Share of System-Critical Parties (% Valid Votes)"

gen string_ASparties =.
label variable string_ASparties "List of Anti-System Parties (Vote Share, type)"

gen voteper_ASparties = .
label variable voteper_ASparties "Total Vote Share of Anti-System Parties (% Valid Votes)"

gen voteper_EL_ASP =.
gen voteper_RL_ASP =.
gen voteper_ER_ASP =.
gen voteper_RR_ASP =.
gen voteper_GREEN_ASP =.
gen voteper_PIRATE_ASP =.
gen voteper_MISC_POP_ASP =.
gen voteper_SEC_NAT_ASP =.
gen voteper_REL_ASP =.
gen voteper_OTHERR_ASP =.
gen voteper_OTHERL_ASP =.

label variable voteper_EL_ASP "Total Vote Share of Extreme Left Anti-System Parties (% VV)"
label variable voteper_RL_ASP "Total Vote Share of Radical Left Anti-System Parties (% VV)"
label variable voteper_ER_ASP "Total Vote Share of Extreme Right Anti-System Parties (% VV)"
label variable voteper_RR_ASP "Total Vote Share of Radical Right Anti-System Parties (% VV)"
label variable voteper_GREEN_ASP "Total Vote Share of Green Anti-System Parties (% VV)"
label variable voteper_PIRATE_ASP "Total Vote Share of Pirate Anti-System Parties (% VV)"
label variable voteper_MISC_POP_ASP "Total Vote Share of Miscellaneous Populist Anti-System Parties (% VV)"
label variable voteper_SEC_NAT_ASP "Total Vote Share of Seccessionist or Irredentist Parties Anti-System Parties (% VV)"
label variable voteper_REL_ASP "Total Vote Share of Reigious Fundamentalist Anti-System Parties (% VV)"
label variable voteper_OTHERR_ASP "Total Vote Share of Other Right-Wing (Libertarians, Monarchists, etc.) Anti-System Parties (% VV)"
label variable voteper_OTHERL_ASP "Total Vote Share of Other Left-Wing (Syndicalists, Social Liberals, Social Credit etc.) Anti-System Parties (% VV)"

tostring string_PSparties, replace
tostring string_CPparties, replace
tostring string_SCparties, replace
tostring string_ASparties, replace

****************************************************************************************************************************************************************************

  *  NOTE:  Vote shares taken from Nohlen (2005); Nohlen, Grotz and Hartmann (2001); Nohlen and Stover (2010); and various official national parliamentary websites.
  
  *  NOTE:  Individual parties categorised by the author in accordance with the principles laid out in Diagram 1.

**************************************** AUSTRALIA ******************************************

***** Source:  Nohlen, Grotz and Hartmann (2001) [1951-1990]
*              Australian Parliament Website (Department of the Parliamentary Library) [1993 - 1998] (More detailed on minor parties than above)
*              Australian Electoral Commission - Tally Room Archive [2001 - 2016]

*1951
replace string_PSparties = "Labor (47.6), Coalition (50.3)" if countryelection == 1
replace string_CPparties = "Independents (1.1, Ind)" if countryelection == 1
replace string_SCparties = "NA" if countryelection == 1
replace string_ASparties = "Communist (1, EL)" if countryelection == 1

replace voteper_PSparties =  97.9    if countryelection == 1
replace voteper_CPparties =   1.1    if countryelection == 1
replace voteper_SCparties =   0      if countryelection == 1
replace voteper_ASparties =   1      if countryelection == 1

replace voteper_EL_ASP = 1       if countryelection == 1
replace voteper_RL_ASP =.        if countryelection == 1
replace voteper_ER_ASP =.        if countryelection == 1
replace voteper_RR_ASP =.        if countryelection == 1
replace voteper_GREEN_ASP =.     if countryelection == 1
replace voteper_PIRATE_ASP =.    if countryelection == 1
replace voteper_MISC_POP_ASP =.  if countryelection == 1
replace voteper_SEC_NAT_ASP =.   if countryelection == 1
replace voteper_REL_ASP =.       if countryelection == 1
replace voteper_OTHERR_ASP =.    if countryelection == 1
replace voteper_OTHERL_ASP =.    if countryelection == 1

*1954
replace string_PSparties = "Labor (50.0), Coalition (47.1)" if countryelection == 2
replace string_CPparties = "Independents (1.7, Ind)" if countryelection == 2
replace string_SCparties = "NA" if countryelection == 2
replace string_ASparties = "Communist (1.2, EL)" if countryelection == 2

replace voteper_PSparties =  97.1 if countryelection == 2
replace voteper_CPparties =   1.7 if countryelection == 2
replace voteper_SCparties =   0   if countryelection == 2
replace voteper_ASparties =   1.2 if countryelection == 2

replace voteper_EL_ASP = 1.2     if countryelection == 2
replace voteper_RL_ASP =.        if countryelection == 2
replace voteper_ER_ASP =.        if countryelection == 2
replace voteper_RR_ASP =.        if countryelection == 2
replace voteper_GREEN_ASP =.     if countryelection == 2
replace voteper_PIRATE_ASP =.    if countryelection == 2
replace voteper_MISC_POP_ASP =.  if countryelection == 2
replace voteper_SEC_NAT_ASP =.   if countryelection == 2
replace voteper_REL_ASP =.       if countryelection == 2
replace voteper_OTHERR_ASP =.    if countryelection == 2
replace voteper_OTHERL_ASP =.    if countryelection == 2


*1955
replace string_PSparties = "Labor (44.6), Coalition (47.6)" if countryelection == 3
replace string_CPparties = "Independents (1.4, Ind), Democratic Labour Party (5.2, Rel)" if countryelection == 3
replace string_SCparties = "NA" if countryelection == 3
replace string_ASparties = "Communist (1.2, EL)" if countryelection == 3

replace voteper_PSparties = 92.2  if countryelection == 3
replace voteper_CPparties =  6.6  if countryelection == 3
replace voteper_SCparties =  0    if countryelection == 3
replace voteper_ASparties =  1.2  if countryelection == 3

replace voteper_EL_ASP = 1.2     if countryelection == 3
replace voteper_RL_ASP =.        if countryelection == 3
replace voteper_ER_ASP =.        if countryelection == 3
replace voteper_RR_ASP =.        if countryelection == 3
replace voteper_GREEN_ASP =.     if countryelection == 3
replace voteper_PIRATE_ASP =.    if countryelection == 3
replace voteper_MISC_POP_ASP =.  if countryelection == 3
replace voteper_SEC_NAT_ASP =.   if countryelection == 3
replace voteper_REL_ASP =.       if countryelection == 3
replace voteper_OTHERR_ASP =.    if countryelection == 3
replace voteper_OTHERL_ASP =.    if countryelection == 3

*1958
replace string_PSparties = "Labor (42.8), Coalition (46.6)" if countryelection == 4
replace string_CPparties = "Independents (0.6, Ind), Democratic LP (9.4, Rel)" if countryelection == 4
replace string_SCparties = "NA" if countryelection == 4
replace string_ASparties = "Communist (0.5, EL)" if countryelection == 4

replace voteper_PSparties = 89.4 if countryelection == 4
replace voteper_CPparties = 10.0 if countryelection == 4
replace voteper_SCparties =  0   if countryelection == 4
replace voteper_ASparties =  0.5 if countryelection == 4

replace voteper_EL_ASP = 0.5       if countryelection == 4
replace voteper_RL_ASP =.        if countryelection == 4
replace voteper_ER_ASP =.        if countryelection == 4
replace voteper_RR_ASP =.        if countryelection == 4
replace voteper_GREEN_ASP =.     if countryelection == 4
replace voteper_PIRATE_ASP =.    if countryelection == 4
replace voteper_MISC_POP_ASP =.  if countryelection == 4
replace voteper_SEC_NAT_ASP =.   if countryelection == 4
replace voteper_REL_ASP =.       if countryelection == 4
replace voteper_OTHERR_ASP =.    if countryelection == 4
replace voteper_OTHERL_ASP =.    if countryelection == 4

*1961
replace string_PSparties = "Labor (47.9), Coalition (42.1)" if countryelection == 5
replace string_CPparties = "Independents (0.8, Ind), Democratic LP (8.7, Rel)" if countryelection == 5
replace string_SCparties = "NA" if countryelection == 5
replace string_ASparties = "Communist (0.5, EL)" if countryelection == 5

replace voteper_PSparties = 90   if countryelection == 5
replace voteper_CPparties =  9.5 if countryelection == 5
replace voteper_SCparties =  0   if countryelection == 5
replace voteper_ASparties =  0.5 if countryelection == 5

replace voteper_EL_ASP = 0.5     if countryelection == 5
replace voteper_RL_ASP =.        if countryelection == 5
replace voteper_ER_ASP =.        if countryelection == 5
replace voteper_RR_ASP =.        if countryelection == 5
replace voteper_GREEN_ASP =.     if countryelection == 5
replace voteper_PIRATE_ASP =.    if countryelection == 5
replace voteper_MISC_POP_ASP =.  if countryelection == 5
replace voteper_SEC_NAT_ASP =.   if countryelection == 5
replace voteper_REL_ASP =.       if countryelection == 5
replace voteper_OTHERR_ASP =.    if countryelection == 5
replace voteper_OTHERL_ASP =.    if countryelection == 5

*1963
replace string_PSparties = "Labor (45.5), Coalition (46)" if countryelection == 6
replace string_CPparties = "Independents (0.5, Ind), Democratic LP (7.4, Rel)" if countryelection == 6
replace string_SCparties = "NA" if countryelection == 6
replace string_ASparties = "Communist (0.6, EL)" if countryelection == 6

replace voteper_PSparties = 91.5 if countryelection == 6
replace voteper_CPparties =  7.9 if countryelection == 6
replace voteper_SCparties =  0   if countryelection == 6
replace voteper_ASparties =  0.6 if countryelection == 6

replace voteper_EL_ASP = 0.6       if countryelection == 6
replace voteper_RL_ASP =.        if countryelection == 6
replace voteper_ER_ASP =.        if countryelection == 6
replace voteper_RR_ASP =.        if countryelection == 6
replace voteper_GREEN_ASP =.     if countryelection == 6
replace voteper_PIRATE_ASP =.    if countryelection == 6
replace voteper_MISC_POP_ASP =.  if countryelection == 6
replace voteper_SEC_NAT_ASP =.   if countryelection == 6
replace voteper_REL_ASP =.       if countryelection == 6
replace voteper_OTHERR_ASP =.    if countryelection == 6
replace voteper_OTHERL_ASP =.    if countryelection == 6

*1966
replace string_PSparties = "Labor (40), Coalition (50)" if countryelection == 7
replace string_CPparties = "Independents (1.5, Ind), Democratic LP (7.3, Rel), Liberal Reform (0.9, Lib)" if countryelection == 7
replace string_SCparties = "NA" if countryelection == 7
replace string_ASparties = "Communist (0.4, EL)" if countryelection == 7

replace voteper_PSparties = 90   if countryelection == 7
replace voteper_CPparties =  9.7 if countryelection == 7
replace voteper_SCparties =  0   if countryelection == 7
replace voteper_ASparties =  0.4 if countryelection == 7

replace voteper_EL_ASP = 0.4       if countryelection == 7
replace voteper_RL_ASP =.        if countryelection == 7
replace voteper_ER_ASP =.        if countryelection == 7
replace voteper_RR_ASP =.        if countryelection == 7
replace voteper_GREEN_ASP =.     if countryelection == 7
replace voteper_PIRATE_ASP =.    if countryelection == 7
replace voteper_MISC_POP_ASP =.  if countryelection == 7
replace voteper_SEC_NAT_ASP =.   if countryelection == 7
replace voteper_REL_ASP =.       if countryelection == 7
replace voteper_OTHERR_ASP =.    if countryelection == 7
replace voteper_OTHERL_ASP =.    if countryelection == 7

*1969
replace string_PSparties = "Labor (47), Coalition (43.3)" if countryelection == 8
replace string_CPparties = "Independents (2.7, Ind), Democratic LP (6, Rel), Australia Party (0.9, Lib)" if countryelection == 8
replace string_SCparties = "NA" if countryelection == 8
replace string_ASparties = "Communist (0.1, EL)" if countryelection == 8

replace voteper_PSparties =  90.3 if countryelection == 8
replace voteper_CPparties =   9.6 if countryelection == 8
replace voteper_SCparties =   0   if countryelection == 8
replace voteper_ASparties =   0.1 if countryelection == 8

replace voteper_EL_ASP = 0.1     if countryelection == 8
replace voteper_RL_ASP =.        if countryelection == 8
replace voteper_ER_ASP =.        if countryelection == 8
replace voteper_RR_ASP =.        if countryelection == 8
replace voteper_GREEN_ASP =.     if countryelection == 8
replace voteper_PIRATE_ASP =.    if countryelection == 8
replace voteper_MISC_POP_ASP =.  if countryelection == 8
replace voteper_SEC_NAT_ASP =.   if countryelection == 8
replace voteper_REL_ASP =.       if countryelection == 8
replace voteper_OTHERR_ASP =.    if countryelection == 8
replace voteper_OTHERL_ASP =.    if countryelection == 8

*1972
replace string_PSparties = "Labor (49.6), Coalition (41.5)" if countryelection == 9
replace string_CPparties = "Independents (1.2, Ind), Democratic LP (5.2, Rel), Australia Party (2.4, Lib)" if countryelection == 9
replace string_SCparties = "NA" if countryelection == 9
replace string_ASparties = "Communist (0.1, EL)" if countryelection == 9

replace voteper_PSparties =  91.1 if countryelection == 9
replace voteper_CPparties =   8.8 if countryelection == 9
replace voteper_SCparties =   0   if countryelection == 9
replace voteper_ASparties =   0.1 if countryelection == 9

replace voteper_EL_ASP = 0.1     if countryelection == 9
replace voteper_RL_ASP =.        if countryelection == 9
replace voteper_ER_ASP =.        if countryelection == 9
replace voteper_RR_ASP =.        if countryelection == 9
replace voteper_GREEN_ASP =.     if countryelection == 9
replace voteper_PIRATE_ASP =.    if countryelection == 9
replace voteper_MISC_POP_ASP =.  if countryelection == 9
replace voteper_SEC_NAT_ASP =.   if countryelection == 9
replace voteper_REL_ASP =.       if countryelection == 9
replace voteper_OTHERR_ASP =.    if countryelection == 9
replace voteper_OTHERL_ASP =.    if countryelection == 9

*1974
replace string_PSparties = "Labor (49.3), Coalition (45.7)" if countryelection == 10
replace string_CPparties = "Independents (0.4, Ind), Democratic LP (1.4, Rel), Australia Party (2.3, Lib), Liberal Movement (0.8, Lib)" if countryelection == 10
replace string_SCparties = "NA" if countryelection == 10
replace string_ASparties = "NA" if countryelection == 10


replace voteper_PSparties = 95   if countryelection == 10
replace voteper_CPparties =  4.9 if countryelection == 10
replace voteper_SCparties =  0   if countryelection == 10
replace voteper_ASparties =  0   if countryelection == 10

replace voteper_EL_ASP =.        if countryelection == 10
replace voteper_RL_ASP =.        if countryelection == 10
replace voteper_ER_ASP =.        if countryelection == 10
replace voteper_RR_ASP =.        if countryelection == 10
replace voteper_GREEN_ASP =.     if countryelection == 10
replace voteper_PIRATE_ASP =.    if countryelection == 10
replace voteper_MISC_POP_ASP =.  if countryelection == 10
replace voteper_SEC_NAT_ASP =.   if countryelection == 10
replace voteper_REL_ASP =.       if countryelection == 10
replace voteper_OTHERR_ASP =.    if countryelection == 10
replace voteper_OTHERL_ASP =.    if countryelection == 10

*1975
replace string_PSparties = "Labor (42.8), Coalition (53)" if countryelection == 11
replace string_CPparties = "Independents (0.9, Ind), Democratic LP (1.3, Rel), Australia Party (0.4, Lib), Liberal Movement (0.6, Lib)" if countryelection == 11
replace string_SCparties = "NA" if countryelection == 11
replace string_ASparties = "Communist (0.1, EL), Progress (0.8, Other Right)" if countryelection == 11

replace voteper_PSparties =  95.8 if countryelection == 11
replace voteper_CPparties =   3.2 if countryelection == 11
replace voteper_SCparties =   0   if countryelection == 11
replace voteper_ASparties =   0.9 if countryelection == 11

replace voteper_EL_ASP = 0.1     if countryelection == 11
replace voteper_RL_ASP =.        if countryelection == 11
replace voteper_ER_ASP =.        if countryelection == 11
replace voteper_RR_ASP =.        if countryelection == 11
replace voteper_GREEN_ASP =.     if countryelection == 11
replace voteper_PIRATE_ASP =.    if countryelection == 11
replace voteper_MISC_POP_ASP =.  if countryelection == 11
replace voteper_SEC_NAT_ASP =.   if countryelection == 11
replace voteper_REL_ASP =.       if countryelection == 11
replace voteper_OTHERR_ASP = 0.8 if countryelection == 11
replace voteper_OTHERL_ASP =.    if countryelection == 11

*1977
replace string_PSparties = "Labor (39.6), Coalition (48.1)" if countryelection == 12
replace string_CPparties = "Independents (0.7, Ind), Democratic LP (1.4, Rel), Democrats (9.4, Lib)" if countryelection == 12
replace string_SCparties = "NA" if countryelection == 12
replace string_ASparties = "Communist (0.2, EL), Progress (0.6, Other Right)" if countryelection == 12

replace voteper_PSparties =  87.7 if countryelection == 12
replace voteper_CPparties =  11.5 if countryelection == 12
replace voteper_SCparties =   0   if countryelection == 12
replace voteper_ASparties =   0.8 if countryelection == 12

replace voteper_EL_ASP = 0.2     if countryelection == 12
replace voteper_RL_ASP =.        if countryelection == 12
replace voteper_ER_ASP =.        if countryelection == 12
replace voteper_RR_ASP =.        if countryelection == 12
replace voteper_GREEN_ASP =.     if countryelection == 12
replace voteper_PIRATE_ASP =.    if countryelection == 12
replace voteper_MISC_POP_ASP =.  if countryelection == 12
replace voteper_SEC_NAT_ASP =.   if countryelection == 12
replace voteper_REL_ASP =.       if countryelection == 12
replace voteper_OTHERR_ASP = 0.6 if countryelection == 12
replace voteper_OTHERL_ASP =.    if countryelection == 12

*1980
replace string_PSparties = "Labor (45.1), Coalition (46.4)" if countryelection == 13
replace string_CPparties = "Independents (0.9, Ind), Democratic LP (0.3, Rel), Democrats (6.6, Lib)" if countryelection == 13
replace string_SCparties = "NA" if countryelection == 13
replace string_ASparties = "Communist + Socialist Workers (0.4, EL), Progress (0.2, Other Right)" if countryelection == 13

replace voteper_PSparties = 91.5 if countryelection == 13
replace voteper_CPparties =  7.8 if countryelection == 13
replace voteper_SCparties =  0   if countryelection == 13
replace voteper_ASparties =  0.6 if countryelection == 13

replace voteper_EL_ASP = 0.4     if countryelection == 13
replace voteper_RL_ASP =.        if countryelection == 13
replace voteper_ER_ASP =.        if countryelection == 13
replace voteper_RR_ASP =.        if countryelection == 13
replace voteper_GREEN_ASP =.     if countryelection == 13
replace voteper_PIRATE_ASP =.    if countryelection == 13
replace voteper_MISC_POP_ASP =.  if countryelection == 13
replace voteper_SEC_NAT_ASP =.   if countryelection == 13
replace voteper_REL_ASP =.       if countryelection == 13
replace voteper_OTHERR_ASP = 0.2 if countryelection == 13
replace voteper_OTHERL_ASP =.    if countryelection == 13

*1983
replace string_PSparties = "Labor (49.5), Coalition (43.6)" if countryelection == 14
replace string_CPparties = "Independents (0.9, Ind), Democratic LP (0.2, Rel), Democrats (5, Lib)" if countryelection == 14
replace string_SCparties = "NA" if countryelection == 14
replace string_ASparties = "Communist + Socialist Workers (0.7, EL)" if countryelection == 14

replace voteper_PSparties =  93.1 if countryelection == 14
replace voteper_CPparties =   6.1 if countryelection == 14
replace voteper_SCparties =   0   if countryelection == 14
replace voteper_ASparties =   0.7 if countryelection == 14

replace voteper_EL_ASP = 0.7     if countryelection == 14
replace voteper_RL_ASP =.        if countryelection == 14
replace voteper_ER_ASP =.        if countryelection == 14
replace voteper_RR_ASP =.        if countryelection == 14
replace voteper_GREEN_ASP =.     if countryelection == 14
replace voteper_PIRATE_ASP =.    if countryelection == 14
replace voteper_MISC_POP_ASP =.  if countryelection == 14
replace voteper_SEC_NAT_ASP =.   if countryelection == 14
replace voteper_REL_ASP =.       if countryelection == 14
replace voteper_OTHERR_ASP =.    if countryelection == 14
replace voteper_OTHERL_ASP =.    if countryelection == 14

*1984
replace string_PSparties = "Labor (47.5), Coalition (45)" if countryelection == 15
replace string_CPparties = "Independents (1.3, Ind), Democratic LP (0.6, Rel), Democrats (5.4, Lib)" if countryelection == 15
replace string_SCparties = "NA" if countryelection == 15
replace string_ASparties = "Communist + Socialist Workers (0.1, EL)" if countryelection == 15

replace voteper_PSparties =  92.5 if countryelection == 15
replace voteper_CPparties =   7.3 if countryelection == 15
replace voteper_SCparties =   0   if countryelection == 15
replace voteper_ASparties =   0.1 if countryelection == 15

replace voteper_EL_ASP = 0.1     if countryelection == 15
replace voteper_RL_ASP =.        if countryelection == 15
replace voteper_ER_ASP =.        if countryelection == 15
replace voteper_RR_ASP =.        if countryelection == 15
replace voteper_GREEN_ASP =.     if countryelection == 15
replace voteper_PIRATE_ASP =.    if countryelection == 15
replace voteper_MISC_POP_ASP =.  if countryelection == 15
replace voteper_SEC_NAT_ASP =.   if countryelection == 15
replace voteper_REL_ASP =.       if countryelection == 15
replace voteper_OTHERR_ASP =.    if countryelection == 15
replace voteper_OTHERL_ASP =.    if countryelection == 15

*1987
replace string_PSparties = "Labor (45.8), Coalition (46.1)" if countryelection == 16
replace string_CPparties = "Independents (2.1, Ind), Democrats (6, Lib)" if countryelection == 16
replace string_SCparties = "NA" if countryelection == 16
replace string_ASparties = "NA" if countryelection == 16

replace voteper_PSparties = 91.9  if countryelection == 16
replace voteper_CPparties =  8.1  if countryelection == 16
replace voteper_SCparties =  0    if countryelection == 16
replace voteper_ASparties =  0    if countryelection == 16

replace voteper_EL_ASP =.       if countryelection == 16
replace voteper_RL_ASP =.        if countryelection == 16
replace voteper_ER_ASP =.        if countryelection == 16
replace voteper_RR_ASP =.        if countryelection == 16
replace voteper_GREEN_ASP =.     if countryelection == 16
replace voteper_PIRATE_ASP =.    if countryelection == 16
replace voteper_MISC_POP_ASP =.  if countryelection == 16
replace voteper_SEC_NAT_ASP =.   if countryelection == 16
replace voteper_REL_ASP =.       if countryelection == 16
replace voteper_OTHERR_ASP =.    if countryelection == 16
replace voteper_OTHERL_ASP =.    if countryelection == 16

*1990
replace string_PSparties = "Labor (39.4), Coalition (43.5)" if countryelection == 17
replace string_CPparties = "Independents (3.1, Ind), Democrats (11.3, Lib), Call to Australia (1, Rel)" if countryelection == 17
replace string_SCparties = "NA" if countryelection == 17
replace string_ASparties = "Democratic Socialist (0.2, EL), Greens (1.4, Green)" if countryelection == 17

replace voteper_PSparties = 82.9  if countryelection == 17
replace voteper_CPparties = 15.4  if countryelection == 17
replace voteper_SCparties =  0    if countryelection == 17
replace voteper_ASparties =  1.6  if countryelection == 17

replace voteper_EL_ASP = 0.2       if countryelection == 17
replace voteper_RL_ASP =.        if countryelection == 17
replace voteper_ER_ASP =.        if countryelection == 17
replace voteper_RR_ASP =.        if countryelection == 17
replace voteper_GREEN_ASP = 1.4     if countryelection == 17
replace voteper_PIRATE_ASP =.    if countryelection == 17
replace voteper_MISC_POP_ASP =.  if countryelection == 17
replace voteper_SEC_NAT_ASP =.   if countryelection == 17
replace voteper_REL_ASP =.       if countryelection == 17
replace voteper_OTHERR_ASP =.    if countryelection == 17
replace voteper_OTHERL_ASP =.    if countryelection == 17

*1993
replace string_PSparties = "Labor (44.9), Coalition (44.3)" if countryelection == 18
replace string_CPparties = "Independents (3.3, Ind), Democrats (3.8, Lib), Call to Australia (0.5, Rel)" if countryelection == 18
replace string_SCparties = "NA" if countryelection == 18
replace string_ASparties = "Confederate Action (0.6, RR), Greens (1.9, Green), Natural Law (0.7, Rel)" if countryelection == 18

replace voteper_PSparties =  89.2 if countryelection == 18
replace voteper_CPparties =   7.6 if countryelection == 18
replace voteper_SCparties =   0   if countryelection == 18
replace voteper_ASparties =   3.2 if countryelection == 18

replace voteper_EL_ASP =.        if countryelection == 18
replace voteper_RL_ASP =.        if countryelection == 18
replace voteper_ER_ASP =.        if countryelection == 18
replace voteper_RR_ASP = 0.6        if countryelection == 18
replace voteper_GREEN_ASP = 1.9     if countryelection == 18
replace voteper_PIRATE_ASP =.    if countryelection == 18
replace voteper_MISC_POP_ASP =.  if countryelection == 18
replace voteper_SEC_NAT_ASP =.   if countryelection == 18
replace voteper_REL_ASP = 0.7       if countryelection == 18
replace voteper_OTHERR_ASP =.    if countryelection == 18
replace voteper_OTHERL_ASP =.    if countryelection == 18

*1996
replace string_PSparties = "Labor (38.8), Coalition (47.2)" if countryelection == 19
replace string_CPparties = "Independents (2.8, Ind), Democrats (6.8, Lib), AAFI (0.7, RR), Call to Australia (0.4, Rel)" if countryelection == 19
replace string_SCparties = "NA" if countryelection == 19
replace string_ASparties = "Greens (2.9, Green), Natural Law (0.4, Rel)" if countryelection == 19

replace voteper_PSparties = 86.0  if countryelection == 19
replace voteper_CPparties = 10.7  if countryelection == 19
replace voteper_SCparties =  0    if countryelection == 19
replace voteper_ASparties =  3.3  if countryelection == 19

replace voteper_EL_ASP =.       if countryelection == 19
replace voteper_RL_ASP =.        if countryelection == 19
replace voteper_ER_ASP =.        if countryelection == 19
replace voteper_RR_ASP =.        if countryelection == 19
replace voteper_GREEN_ASP = 2.9     if countryelection == 19
replace voteper_PIRATE_ASP =.    if countryelection == 19
replace voteper_MISC_POP_ASP =.  if countryelection == 19
replace voteper_SEC_NAT_ASP =.   if countryelection == 19
replace voteper_REL_ASP = 0.4       if countryelection == 19
replace voteper_OTHERR_ASP =.    if countryelection == 19
replace voteper_OTHERL_ASP =.    if countryelection == 19

*1998
replace string_PSparties = "Labor (40.1), Coalition (39.5)" if countryelection == 20
replace string_CPparties = "Independents (2.5, Ind), Democrats (5.1, Lib), Call to Australia (0.6, Rel), Unity (0.8, Lib)" if countryelection == 20
replace string_SCparties = "NA" if countryelection == 20
replace string_ASparties = "Greens (2.6, Green), One Nation (8.4, RR), Australia First (0.3, ER)" if countryelection == 20

replace voteper_PSparties =  79.6 if countryelection == 20
replace voteper_CPparties =   9   if countryelection == 20
replace voteper_SCparties =   0   if countryelection == 20
replace voteper_ASparties =  11.3 if countryelection == 20

replace voteper_EL_ASP =.       if countryelection == 20
replace voteper_RL_ASP =.        if countryelection == 20
replace voteper_ER_ASP = 0.3        if countryelection == 20
replace voteper_RR_ASP = 8.4        if countryelection == 20
replace voteper_GREEN_ASP = 2.6    if countryelection == 20
replace voteper_PIRATE_ASP =.    if countryelection == 20
replace voteper_MISC_POP_ASP =.  if countryelection == 20
replace voteper_SEC_NAT_ASP =.   if countryelection == 20
replace voteper_REL_ASP =.       if countryelection == 20
replace voteper_OTHERR_ASP =.    if countryelection == 20
replace voteper_OTHERL_ASP =.    if countryelection == 20

*2001
replace string_PSparties = "Labor (37.7), Coalition (43.4)" if countryelection == 21
replace string_CPparties = "Independents (3.4, Ind), Democrats (5.4, Lib), Call to Australia (0.6, Rel), Unity (0.2, Lib)" if countryelection == 21
replace string_SCparties = "NA" if countryelection == 21
replace string_ASparties = "Greens (5, Green), One Nation (4.3, RR)" if countryelection == 21

replace voteper_PSparties = 81.1  if countryelection == 21
replace voteper_CPparties =  9.6  if countryelection == 21
replace voteper_SCparties =  0    if countryelection == 21
replace voteper_ASparties =  9.3  if countryelection == 21

replace voteper_EL_ASP =.       if countryelection == 21
replace voteper_RL_ASP =.        if countryelection == 21
replace voteper_ER_ASP =.        if countryelection == 21
replace voteper_RR_ASP = 4.3        if countryelection == 21
replace voteper_GREEN_ASP = 5     if countryelection == 21
replace voteper_PIRATE_ASP =.    if countryelection == 21
replace voteper_MISC_POP_ASP =.  if countryelection == 21
replace voteper_SEC_NAT_ASP =.   if countryelection == 21
replace voteper_REL_ASP =.       if countryelection == 21
replace voteper_OTHERR_ASP =.    if countryelection == 21
replace voteper_OTHERL_ASP =.    if countryelection == 21

*2004
replace string_PSparties = "Labor (37.6), Coalition (46.7)" if countryelection == 22
replace string_CPparties = "Independents (3.1, Ind), Democrats (1.2, Lib), Christian Party (0.6, Rel), Family First (2, Rel)" if countryelection == 22
replace string_SCparties = "NA" if countryelection == 22
replace string_ASparties = "Greens (7.2, Green), One Nation (1.2, RR), CEC (0.3, ER)" if countryelection == 22

replace voteper_PSparties = 84.3 if countryelection == 22
replace voteper_CPparties =  6.9 if countryelection == 22
replace voteper_SCparties =  0   if countryelection == 22
replace voteper_ASparties =  8.7 if countryelection == 22

replace voteper_EL_ASP =.       if countryelection == 22
replace voteper_RL_ASP =.        if countryelection == 22
replace voteper_ER_ASP = 0.3        if countryelection == 22
replace voteper_RR_ASP = 1.2        if countryelection == 22
replace voteper_GREEN_ASP = 7.2     if countryelection == 22
replace voteper_PIRATE_ASP =.    if countryelection == 22
replace voteper_MISC_POP_ASP =.  if countryelection == 22
replace voteper_SEC_NAT_ASP =.   if countryelection == 22
replace voteper_REL_ASP =.       if countryelection == 22
replace voteper_OTHERR_ASP =.    if countryelection == 22
replace voteper_OTHERL_ASP =.    if countryelection == 22

*2007
replace string_PSparties = "Labor (43.4), Coalition (42.1)" if countryelection == 23
replace string_CPparties = "Independents (2.7, Ind), Democrats (0.7, Lib), Christian Party (0.8, Rel), Family First (2, Rel)" if countryelection == 23
replace string_SCparties = "NA" if countryelection == 23
replace string_ASparties = "Greens (7.8, Green), One Nation (0.3, RR), CEC (0.2, ER)" if countryelection == 23

replace voteper_PSparties = 85.5 if countryelection == 23
replace voteper_CPparties =  6.2 if countryelection == 23
replace voteper_SCparties =  0   if countryelection == 23
replace voteper_ASparties =  8.3 if countryelection == 23

replace voteper_EL_ASP =.       if countryelection == 23
replace voteper_RL_ASP =.        if countryelection == 23
replace voteper_ER_ASP = 0.2        if countryelection == 23
replace voteper_RR_ASP = 0.3        if countryelection == 23
replace voteper_GREEN_ASP = 7.8     if countryelection == 23
replace voteper_PIRATE_ASP =.    if countryelection == 23
replace voteper_MISC_POP_ASP =.  if countryelection == 23
replace voteper_SEC_NAT_ASP =.   if countryelection == 23
replace voteper_REL_ASP =.       if countryelection == 23
replace voteper_OTHERR_ASP =.    if countryelection == 23
replace voteper_OTHERL_ASP =.    if countryelection == 23

*2010
replace string_PSparties = "Labor (38), Coalition (43.6)" if countryelection == 24
replace string_CPparties = "Independents (3.0, Ind), Greens (11.8, Green), Democrats (0.2, Lib), Call to Australia (0.7, Rel), Family First (2.3, Rel)" if countryelection == 24
replace string_SCparties = "NA" if countryelection == 24
replace string_ASparties = "Socialist Alliance (0.2, RL), One Nation (0.2, RR), CEC (0.1, ER)" if countryelection == 24

replace voteper_PSparties =  81.6 if countryelection == 24
replace voteper_CPparties =  18.0 if countryelection == 24
replace voteper_SCparties =   0   if countryelection == 24
replace voteper_ASparties =   0.5 if countryelection == 24

replace voteper_EL_ASP =.       if countryelection == 24
replace voteper_RL_ASP = 0.2        if countryelection == 24
replace voteper_ER_ASP = 0.1        if countryelection == 24
replace voteper_RR_ASP = 0.2       if countryelection == 24
replace voteper_GREEN_ASP =.     if countryelection == 24
replace voteper_PIRATE_ASP =.    if countryelection == 24
replace voteper_MISC_POP_ASP =.  if countryelection == 24
replace voteper_SEC_NAT_ASP =.   if countryelection == 24
replace voteper_REL_ASP =.       if countryelection == 24
replace voteper_OTHERR_ASP =.    if countryelection == 24
replace voteper_OTHERL_ASP =.    if countryelection == 24

*2013
replace string_PSparties = "Labor (33.4), Coalition (45.5), Greens (8.7, Green)" if countryelection == 25
replace string_CPparties = "Independents (2.3, Ind), Palmer UTD (5.5, Lib), Australian Christian (0.3, Rel), Christian Democrats (0.7, Rel), Sex Party (0.6, CP), Family First (1.4, Rel)" if countryelection == 25
replace string_SCparties = "NA" if countryelection == 25
replace string_ASparties = "Katter's Australian (1, MISC_POP), Rise Up (0.4, RR), One Nation (0.2, RR)" if countryelection == 25

replace voteper_PSparties = 87.6 if countryelection == 25
replace voteper_CPparties = 10.8 if countryelection == 25
replace voteper_SCparties =  0   if countryelection == 25
replace voteper_ASparties =  1.6 if countryelection == 25

replace voteper_EL_ASP =.       if countryelection == 25
replace voteper_RL_ASP =.        if countryelection == 25
replace voteper_ER_ASP =.        if countryelection == 25
replace voteper_RR_ASP = 0.6       if countryelection == 25
replace voteper_GREEN_ASP =.     if countryelection == 25
replace voteper_PIRATE_ASP =.    if countryelection == 25
replace voteper_MISC_POP_ASP = 1  if countryelection == 25
replace voteper_SEC_NAT_ASP =.   if countryelection == 25
replace voteper_REL_ASP =.       if countryelection == 25
replace voteper_OTHERR_ASP =.    if countryelection == 25
replace voteper_OTHERL_ASP =.    if countryelection == 25

*2016
replace string_PSparties = "Labor (34.7), Coalition (42), Greens (10.2, Green)" if countryelection == 26
replace string_CPparties = "Independents (4.4, Ind), Xenophon Team (1.9, Lib), Animal Justice (0.7, Anm) Australian Christian (0.3, Rel), Christian Democrats (1.3, Rel), Family First (1.5, Rel)" if countryelection == 26
replace string_SCparties = "NA" if countryelection == 26
replace string_ASparties = "Liberal Democratic (0.5, OR), Katter's Australian (0.5, MISC_POP), Rise Up (0.5, RR), One Nation (1.3, RR)" if countryelection == 26

replace voteper_PSparties = 86.9 if countryelection == 26
replace voteper_CPparties = 10.2 if countryelection == 26
replace voteper_SCparties =  0   if countryelection == 26
replace voteper_ASparties =  2.8 if countryelection == 26

replace voteper_EL_ASP =.        if countryelection == 26
replace voteper_RL_ASP =.        if countryelection == 26
replace voteper_ER_ASP =.        if countryelection == 26
replace voteper_RR_ASP = 1.8        if countryelection == 26
replace voteper_GREEN_ASP =.     if countryelection == 26
replace voteper_PIRATE_ASP =.    if countryelection == 26
replace voteper_MISC_POP_ASP = 0.5  if countryelection == 26
replace voteper_SEC_NAT_ASP =.   if countryelection == 26
replace voteper_REL_ASP =.       if countryelection == 26
replace voteper_OTHERR_ASP = 0.5    if countryelection == 26
replace voteper_OTHERL_ASP =.    if countryelection == 26



************************************************************ AUSTRIA ***********************************************************

***** Source:  Nohlen and Stover (2010) [1953-2008]
*              Bundesministerium Fur Inneres - National Council Election 2013 Website [2013]


*1953
replace string_PSparties = "OVP (41.3), SPO (42.1)" if countryelection == 27
replace string_CPparties = "Independents/Other (0.4, Ind)" if countryelection == 27
replace string_SCparties = "NA" if countryelection == 27
replace string_ASparties = "KPO (5.3, EL), Electoral Independents (10.9, SEC.)" if countryelection == 27

replace voteper_PSparties = 83.4 if countryelection == 27
replace voteper_CPparties =  0.4 if countryelection == 27
replace voteper_SCparties =  0   if countryelection == 27
replace voteper_ASparties = 16.2 if countryelection == 27

replace voteper_EL_ASP = 5.3       if countryelection == 27
replace voteper_RL_ASP =.        if countryelection == 27
replace voteper_ER_ASP =.        if countryelection == 27
replace voteper_RR_ASP = .       if countryelection == 27
replace voteper_GREEN_ASP =.     if countryelection == 27
replace voteper_PIRATE_ASP =.    if countryelection == 27
replace voteper_MISC_POP_ASP =.  if countryelection == 27
replace voteper_SEC_NAT_ASP = 10.9   if countryelection == 27
replace voteper_REL_ASP =.       if countryelection == 27
replace voteper_OTHERR_ASP =.    if countryelection == 27
replace voteper_OTHERL_ASP =.    if countryelection == 27

*1956
replace string_PSparties = "OVP (46), SPO (43)" if countryelection == 28
replace string_CPparties = "Independents/Other (0.1, Ind)" if countryelection == 28
replace string_SCparties = "NA" if countryelection == 28
replace string_ASparties = "KPO (4.4, EL), FPO (6.5, SEC.)" if countryelection == 28

replace voteper_PSparties = 89    if countryelection == 28
replace voteper_CPparties =  0.1  if countryelection == 28
replace voteper_SCparties =  0    if countryelection == 28
replace voteper_ASparties =  10.9 if countryelection == 28

replace voteper_EL_ASP = 4.4      if countryelection == 28
replace voteper_RL_ASP =.        if countryelection == 28
replace voteper_ER_ASP =.        if countryelection == 28
replace voteper_RR_ASP = .       if countryelection == 28
replace voteper_GREEN_ASP =.     if countryelection == 28
replace voteper_PIRATE_ASP =.    if countryelection == 28
replace voteper_MISC_POP_ASP =.  if countryelection == 28
replace voteper_SEC_NAT_ASP = 6.5   if countryelection == 28
replace voteper_REL_ASP =.       if countryelection == 28
replace voteper_OTHERR_ASP =.    if countryelection == 28
replace voteper_OTHERL_ASP =.    if countryelection == 28

*1959
replace string_PSparties = "OVP (44.2), SPO (44.8)" if countryelection == 29
replace string_CPparties = "NA" if countryelection == 29
replace string_SCparties = "FPO (7.7, Nat)" if countryelection == 29
replace string_ASparties = "KPO (3.3, EL)" if countryelection == 29

replace voteper_PSparties =  89    if countryelection == 29
replace voteper_CPparties =   0    if countryelection == 29
replace voteper_SCparties =   7.7  if countryelection == 29
replace voteper_ASparties =   3.3  if countryelection == 29

replace voteper_EL_ASP = 3.3      if countryelection == 29
replace voteper_RL_ASP =.        if countryelection == 29
replace voteper_ER_ASP =.        if countryelection == 29
replace voteper_RR_ASP = .       if countryelection == 29
replace voteper_GREEN_ASP =.     if countryelection == 29
replace voteper_PIRATE_ASP =.    if countryelection == 29
replace voteper_MISC_POP_ASP =.  if countryelection == 29
replace voteper_SEC_NAT_ASP = .  if countryelection == 29
replace voteper_REL_ASP =.       if countryelection == 29
replace voteper_OTHERR_ASP =.    if countryelection == 29
replace voteper_OTHERL_ASP =.    if countryelection == 29

*1962
replace string_PSparties = "OVP (45.4), SPO (44)" if countryelection == 30
replace string_CPparties = "Eurofederalist (0.5, Lib)" if countryelection == 30
replace string_SCparties = "FPO (7, Nat)" if countryelection == 30
replace string_ASparties = "KPO (3, EL)" if countryelection == 30

replace voteper_PSparties = 89.4 if countryelection == 30
replace voteper_CPparties =  0.5 if countryelection == 30
replace voteper_SCparties =  7   if countryelection == 30
replace voteper_ASparties =  3   if countryelection == 30

replace voteper_EL_ASP = 3       if countryelection == 30
replace voteper_RL_ASP =.        if countryelection == 30
replace voteper_ER_ASP =.        if countryelection == 30
replace voteper_RR_ASP = .       if countryelection == 30
replace voteper_GREEN_ASP =.     if countryelection == 30
replace voteper_PIRATE_ASP =.    if countryelection == 30
replace voteper_MISC_POP_ASP =.  if countryelection == 30
replace voteper_SEC_NAT_ASP = .   if countryelection == 30
replace voteper_REL_ASP =.       if countryelection == 30
replace voteper_OTHERR_ASP =.    if countryelection == 30
replace voteper_OTHERL_ASP =.    if countryelection == 30

*1966
replace string_PSparties = "OVP (48.3), SPO (42.6)" if countryelection == 31
replace string_CPparties = "NA" if countryelection == 31
replace string_SCparties = "FPO (5.4, Nat)" if countryelection == 31
replace string_ASparties = "KPO (0.4, EL), Democratic Progressive Party (3.3, RR)" if countryelection == 31

replace voteper_PSparties = 90.9 if countryelection == 31
replace voteper_CPparties =  0   if countryelection == 31
replace voteper_SCparties =  5.4 if countryelection == 31
replace voteper_ASparties =  3.7 if countryelection == 31

replace voteper_EL_ASP = 0.4      if countryelection == 31
replace voteper_RL_ASP =.        if countryelection == 31
replace voteper_ER_ASP =.        if countryelection == 31
replace voteper_RR_ASP = 3.3       if countryelection == 31
replace voteper_GREEN_ASP =.     if countryelection == 31
replace voteper_PIRATE_ASP =.    if countryelection == 31
replace voteper_MISC_POP_ASP =.  if countryelection == 31
replace voteper_SEC_NAT_ASP = .   if countryelection == 31
replace voteper_REL_ASP =.       if countryelection == 31
replace voteper_OTHERR_ASP =.    if countryelection == 31
replace voteper_OTHERL_ASP =.    if countryelection == 31

*1970
replace string_PSparties = "OVP (44.7), SPO (48.4)" if countryelection == 32
replace string_CPparties = "NA" if countryelection == 32
replace string_SCparties = "FPO (5.5, Nat)" if countryelection == 32
replace string_ASparties = "KPO (1, EL), Democratic Progressive Party (0.3, RR), National Democratic (0.1, ER)" if countryelection == 32

replace voteper_PSparties = 93.1 if countryelection == 32
replace voteper_CPparties =  0   if countryelection == 32
replace voteper_SCparties =  5.5 if countryelection == 32
replace voteper_ASparties =  1.4 if countryelection == 32

replace voteper_EL_ASP = 1       if countryelection == 32
replace voteper_RL_ASP = .        if countryelection == 32
replace voteper_ER_ASP = 0.1        if countryelection == 32
replace voteper_RR_ASP = 0.3      if countryelection == 32
replace voteper_GREEN_ASP =.     if countryelection == 32
replace voteper_PIRATE_ASP =.    if countryelection == 32
replace voteper_MISC_POP_ASP =.  if countryelection == 32
replace voteper_SEC_NAT_ASP = .   if countryelection == 32
replace voteper_REL_ASP =.       if countryelection == 32
replace voteper_OTHERR_ASP =.    if countryelection == 32
replace voteper_OTHERL_ASP =.    if countryelection == 32

*1971
replace string_PSparties = "OVP (43.1), SPO (50), FPO (5.5, Nat)" if countryelection == 33
replace string_CPparties = "NA" if countryelection == 33
replace string_SCparties = "NA" if countryelection == 33
replace string_ASparties = "KPO (1.4, EL)" if countryelection == 33

replace voteper_PSparties = 98.6 if countryelection == 33
replace voteper_CPparties =  0   if countryelection == 33
replace voteper_SCparties =  0   if countryelection == 33
replace voteper_ASparties =  1.4 if countryelection == 33

replace voteper_EL_ASP = 1.4      if countryelection == 33
replace voteper_RL_ASP =.        if countryelection == 33
replace voteper_ER_ASP =.        if countryelection == 33
replace voteper_RR_ASP = .       if countryelection == 33
replace voteper_GREEN_ASP =.     if countryelection == 33
replace voteper_PIRATE_ASP =.    if countryelection == 33
replace voteper_MISC_POP_ASP =.  if countryelection == 33
replace voteper_SEC_NAT_ASP = .   if countryelection == 33
replace voteper_REL_ASP =.       if countryelection == 33
replace voteper_OTHERR_ASP =.    if countryelection == 33
replace voteper_OTHERL_ASP =.    if countryelection == 33

*1975
replace string_PSparties = "OVP (42.9), SPO (50.4), FPO (5.4, Nat)" if countryelection == 34
replace string_CPparties = "NA" if countryelection == 34
replace string_SCparties = "NA" if countryelection == 34
replace string_ASparties = "KPO (1.2, EL)" if countryelection == 34

replace voteper_PSparties = 98.7 if countryelection == 34
replace voteper_CPparties =  0   if countryelection == 34
replace voteper_SCparties =  0   if countryelection == 34
replace voteper_ASparties =  1.2 if countryelection == 34

replace voteper_EL_ASP = 1.2      if countryelection == 34
replace voteper_RL_ASP =.        if countryelection == 34
replace voteper_ER_ASP =.        if countryelection == 34
replace voteper_RR_ASP = .       if countryelection == 34
replace voteper_GREEN_ASP =.     if countryelection == 34
replace voteper_PIRATE_ASP =.    if countryelection == 34
replace voteper_MISC_POP_ASP =.  if countryelection == 34
replace voteper_SEC_NAT_ASP = .   if countryelection == 34
replace voteper_REL_ASP =.       if countryelection == 34
replace voteper_OTHERR_ASP =.    if countryelection == 34
replace voteper_OTHERL_ASP =.    if countryelection == 34

*1979
replace string_PSparties = "OVP (41.9), SPO (51), FPO (6.1, Nat)" if countryelection == 35
replace string_CPparties = "NA" if countryelection == 35
replace string_SCparties = "NA" if countryelection == 35
replace string_ASparties = "KPO (1, EL)" if countryelection == 35

replace voteper_PSparties =  99 if countryelection == 35
replace voteper_CPparties =   0 if countryelection == 35
replace voteper_SCparties =   0 if countryelection == 35
replace voteper_ASparties =   1 if countryelection == 35

replace voteper_EL_ASP = 1       if countryelection == 35
replace voteper_RL_ASP =.        if countryelection == 35
replace voteper_ER_ASP =.        if countryelection == 35
replace voteper_RR_ASP = .       if countryelection == 35
replace voteper_GREEN_ASP =.     if countryelection == 35
replace voteper_PIRATE_ASP =.    if countryelection == 35
replace voteper_MISC_POP_ASP =.  if countryelection == 35
replace voteper_SEC_NAT_ASP = .   if countryelection == 35
replace voteper_REL_ASP =.       if countryelection == 35
replace voteper_OTHERR_ASP =.    if countryelection == 35
replace voteper_OTHERL_ASP =.    if countryelection == 35

*1983
replace string_PSparties = "OVP (43.2), SPO (47.6), FPO (5, Nat)" if countryelection == 36
replace string_CPparties = "Independent/Other (Ind, 0.2), United Greens (1.9, Green)" if countryelection == 36
replace string_SCparties = "NA" if countryelection == 36
replace string_ASparties = "KPO (0.7, Com), Alternative List (1.4, Green)" if countryelection == 36

replace voteper_PSparties =  95.8 if countryelection == 36
replace voteper_CPparties =   2.1 if countryelection == 36
replace voteper_SCparties =   0   if countryelection == 36
replace voteper_ASparties =   2.1 if countryelection == 36

replace voteper_EL_ASP = 0.7      if countryelection == 36
replace voteper_RL_ASP =.        if countryelection == 36
replace voteper_ER_ASP =.        if countryelection == 36
replace voteper_RR_ASP = .       if countryelection == 36
replace voteper_GREEN_ASP = 1.4     if countryelection == 36
replace voteper_PIRATE_ASP =.    if countryelection == 36
replace voteper_MISC_POP_ASP =.  if countryelection == 36
replace voteper_SEC_NAT_ASP = .   if countryelection == 36
replace voteper_REL_ASP =.       if countryelection == 36
replace voteper_OTHERR_ASP =.    if countryelection == 36
replace voteper_OTHERL_ASP =.    if countryelection == 36

*1986
replace string_PSparties = "OVP (41.3), SPO (43.1)" if countryelection == 37
replace string_CPparties = "Independent/Other (Ind, 0.3)" if countryelection == 37
replace string_SCparties = "FPO (9.7, RR)" if countryelection == 37
replace string_ASparties = "KPO (0.7, EL), Alternative List (4.8, Green)" if countryelection == 37

replace voteper_PSparties = 84.4 if countryelection == 37
replace voteper_CPparties =  0.3 if countryelection == 37
replace voteper_SCparties =  9.7 if countryelection == 37
replace voteper_ASparties =  5.5 if countryelection == 37

replace voteper_EL_ASP = 0.7      if countryelection == 37
replace voteper_RL_ASP =.        if countryelection == 37
replace voteper_ER_ASP =.        if countryelection == 37
replace voteper_RR_ASP = .       if countryelection == 37
replace voteper_GREEN_ASP = 4.8     if countryelection == 37
replace voteper_PIRATE_ASP =.    if countryelection == 37
replace voteper_MISC_POP_ASP =.  if countryelection == 37
replace voteper_SEC_NAT_ASP = .   if countryelection == 37
replace voteper_REL_ASP =.       if countryelection == 37
replace voteper_OTHERR_ASP =.    if countryelection == 37
replace voteper_OTHERL_ASP =.    if countryelection == 37

*1990
replace string_PSparties = "OVP (32.1), SPO (42.8)" if countryelection == 38
replace string_CPparties = "Independent/Other (Ind, 1.3), United Greens (2, Green)" if countryelection == 38
replace string_SCparties = "NA" if countryelection == 38
replace string_ASparties = "KPO (0.5, EL), FPO (16.6, RR), Alternative Green (4.8, Green)" if countryelection == 38

replace voteper_PSparties = 74.9 if countryelection == 38
replace voteper_CPparties =  3.3 if countryelection == 38
replace voteper_SCparties =  0   if countryelection == 38
replace voteper_ASparties = 21.9 if countryelection == 38

replace voteper_EL_ASP = 0.5       if countryelection == 38
replace voteper_RL_ASP =.        if countryelection == 38
replace voteper_ER_ASP =.        if countryelection == 38
replace voteper_RR_ASP = 16.6       if countryelection == 38
replace voteper_GREEN_ASP = 4.8     if countryelection == 38
replace voteper_PIRATE_ASP =.    if countryelection == 38
replace voteper_MISC_POP_ASP =.  if countryelection == 38
replace voteper_SEC_NAT_ASP = .   if countryelection == 38
replace voteper_REL_ASP =.       if countryelection == 38
replace voteper_OTHERR_ASP =.    if countryelection == 38
replace voteper_OTHERL_ASP =.    if countryelection == 38

*1994
replace string_PSparties = "OVP (27.7), SPO (34.9)" if countryelection == 39
replace string_CPparties = "Independent/Other (Ind, 0.3), United Greens (0.1, Green), Liberal Forum (6, Lib)" if countryelection == 39
replace string_SCparties = "NA" if countryelection == 39
replace string_ASparties = "KPO (0.3, EL), FPO (22.5, RR), Alternative Green (7.3, Green), Citizen Action Group (0.9,  Misc. Pop)" if countryelection == 39

replace voteper_PSparties = 62.6 if countryelection == 39
replace voteper_CPparties =  6.4 if countryelection == 39
replace voteper_SCparties =  0   if countryelection == 39
replace voteper_ASparties = 31.0 if countryelection == 39

replace voteper_EL_ASP = 0.3      if countryelection == 39
replace voteper_RL_ASP =.        if countryelection == 39
replace voteper_ER_ASP =.        if countryelection == 39
replace voteper_RR_ASP = 22.5       if countryelection == 39
replace voteper_GREEN_ASP = 7.3     if countryelection == 39
replace voteper_PIRATE_ASP =.    if countryelection == 39
replace voteper_MISC_POP_ASP = 0.9  if countryelection == 39
replace voteper_SEC_NAT_ASP = .   if countryelection == 39
replace voteper_REL_ASP =.       if countryelection == 39
replace voteper_OTHERR_ASP =.    if countryelection == 39
replace voteper_OTHERL_ASP =.    if countryelection == 39

*1995
replace string_PSparties = "OVP (28.3), SPO (38.1)" if countryelection == 40
replace string_CPparties = "United Greens (0.1, Green), Liberal Forum (5.5, Lib)" if countryelection == 40
replace string_SCparties = "NA" if countryelection == 40
replace string_ASparties = "KPO (0.3, EL), FPO (21.9, RR), Alternative Green (4.8, Green), Citizen Action Group (1.1,  Misc. Pop)" if countryelection == 40

replace voteper_PSparties = 66.4 if countryelection == 40
replace voteper_CPparties =  5.6 if countryelection == 40
replace voteper_SCparties =  0   if countryelection == 40
replace voteper_ASparties = 28.1 if countryelection == 40

replace voteper_EL_ASP = 0.3      if countryelection == 40
replace voteper_RL_ASP =.        if countryelection == 40
replace voteper_ER_ASP =.        if countryelection == 40
replace voteper_RR_ASP = 21.9       if countryelection == 40
replace voteper_GREEN_ASP = 4.8     if countryelection == 40
replace voteper_PIRATE_ASP =.    if countryelection == 40
replace voteper_MISC_POP_ASP = 1.1  if countryelection == 40
replace voteper_SEC_NAT_ASP = .   if countryelection == 40
replace voteper_REL_ASP =.       if countryelection == 40
replace voteper_OTHERR_ASP =.    if countryelection == 40
replace voteper_OTHERL_ASP =.    if countryelection == 40

*1999
replace string_PSparties = "OVP (26.9), SPO (33.2)" if countryelection == 41
replace string_CPparties = "Independent/Other (Ind, 1), United Greens (0.1, Green), Liberal Forum (3.6, Lib)" if countryelection == 41
replace string_SCparties = "NA" if countryelection == 41
replace string_ASparties = "KPO (0.5, EL), FPO (26.9, RR), Alternative Green (7.4, Green), Citizen Action Group (0.4,  Misc. Pop)" if countryelection == 41

replace voteper_PSparties = 60.1 if countryelection == 41
replace voteper_CPparties =  4.7 if countryelection == 41
replace voteper_SCparties =  0   if countryelection == 41
replace voteper_ASparties = 35.2 if countryelection == 41

replace voteper_EL_ASP = 0.5      if countryelection == 41
replace voteper_RL_ASP =.        if countryelection == 41
replace voteper_ER_ASP =.        if countryelection == 41
replace voteper_RR_ASP = 26.9       if countryelection == 41
replace voteper_GREEN_ASP = 7.4    if countryelection == 41
replace voteper_PIRATE_ASP =.    if countryelection == 41
replace voteper_MISC_POP_ASP = 0.4  if countryelection == 41
replace voteper_SEC_NAT_ASP = .   if countryelection == 41
replace voteper_REL_ASP =.       if countryelection == 41
replace voteper_OTHERR_ASP =.    if countryelection == 41
replace voteper_OTHERL_ASP =.    if countryelection == 41

*2002
replace string_PSparties = "OVP (42.3), SPO (36.5)" if countryelection == 42
replace string_CPparties = "Independent/Other (Ind, 0.2), Alternative Greens (9.5, Green), Liberal Forum (1, Lib)" if countryelection == 42
replace string_SCparties = "FPO (10, RR)" if countryelection == 42
replace string_ASparties = "KPO (0.6, EL)" if countryelection == 42

replace voteper_PSparties = 78.8  if countryelection == 42
replace voteper_CPparties = 10.7 if countryelection == 42
replace voteper_SCparties = 10  if countryelection == 42
replace voteper_ASparties = 0.6 if countryelection == 42

replace voteper_EL_ASP = 0.6      if countryelection == 42
replace voteper_RL_ASP =.        if countryelection == 42
replace voteper_ER_ASP =.        if countryelection == 42
replace voteper_RR_ASP = .       if countryelection == 42
replace voteper_GREEN_ASP =.     if countryelection == 42
replace voteper_PIRATE_ASP =.    if countryelection == 42
replace voteper_MISC_POP_ASP =.  if countryelection == 42
replace voteper_SEC_NAT_ASP = .   if countryelection == 42
replace voteper_REL_ASP =.       if countryelection == 42
replace voteper_OTHERR_ASP =.    if countryelection == 42
replace voteper_OTHERL_ASP =.    if countryelection == 42

*2006
replace string_PSparties = "OVP (34.3), SPO (35.3)" if countryelection == 43
replace string_CPparties = "Independent/Other (Ind, 0.5), Alternative Greens (11.0, Green)" if countryelection == 43
replace string_SCparties = "BZO (4.1, Nat)" if countryelection == 43
replace string_ASparties = "KPO (1, EL), FPO (11.0, RR), Dr Martin List (2.8, Misc. Pop)" if countryelection == 43

replace voteper_PSparties = 69.8 if countryelection == 43
replace voteper_CPparties = 11.5  if countryelection == 43
replace voteper_SCparties =  4.1  if countryelection == 43
replace voteper_ASparties = 14.8  if countryelection == 43

replace voteper_EL_ASP = 1      if countryelection == 43
replace voteper_RL_ASP =.        if countryelection == 43
replace voteper_ER_ASP =.        if countryelection == 43
replace voteper_RR_ASP = 11.0       if countryelection == 43
replace voteper_GREEN_ASP =.     if countryelection == 43
replace voteper_PIRATE_ASP =.    if countryelection == 43
replace voteper_MISC_POP_ASP = 2.8  if countryelection == 43
replace voteper_SEC_NAT_ASP = .   if countryelection == 43
replace voteper_REL_ASP =.       if countryelection == 43
replace voteper_OTHERR_ASP =.    if countryelection == 43
replace voteper_OTHERL_ASP =.    if countryelection == 43

*2008
replace string_PSparties = "OVP (26), SPO (29.3), Liberal Forum (2.1, Lib)" if countryelection == 44
replace string_CPparties = "Independent/Other (Ind, 0.1), Alternative Greens (10.4, Green), Christians (0.6, Rel), Citizen Forum (1.8, Lib)" if countryelection == 44
replace string_SCparties = "BZO (10.7, Nat)" if countryelection == 44
replace string_ASparties = "KPO (0.8, EL), FPO (17.5, RR), Save Austria (0.7, RR)" if countryelection == 44

replace voteper_PSparties = 57.4 if countryelection == 44
replace voteper_CPparties = 12.9 if countryelection == 44
replace voteper_SCparties = 10.7  if countryelection == 44
replace voteper_ASparties = 19.0 if countryelection == 44

replace voteper_EL_ASP = 0.8      if countryelection == 44
replace voteper_RL_ASP =.        if countryelection == 44
replace voteper_ER_ASP =.        if countryelection == 44
replace voteper_RR_ASP = 18.2      if countryelection == 44
replace voteper_GREEN_ASP =.     if countryelection == 44
replace voteper_PIRATE_ASP =.    if countryelection == 44
replace voteper_MISC_POP_ASP =.  if countryelection == 44
replace voteper_SEC_NAT_ASP = .   if countryelection == 44
replace voteper_REL_ASP =.       if countryelection == 44
replace voteper_OTHERR_ASP =.    if countryelection == 44
replace voteper_OTHERL_ASP =.    if countryelection == 44

*2013
replace string_PSparties = "OVP (24), SPO (26.8)" if countryelection == 45
replace string_CPparties = "Independent/Other (Ind, 0.3), Alternative Greens (12.4, Green), NEOS (5, OL)" if countryelection == 45
replace string_SCparties = "BZO (3.5, Nat)" if countryelection == 45
replace string_ASparties = "KPO (1, EL), FPO (20.5, RR), Team Stronach (5.7, Misc. Pop), Pirate Party (0.8, Pirate)" if countryelection == 45

replace voteper_PSparties = 50.8 if countryelection == 45
replace voteper_CPparties = 17.7  if countryelection == 45
replace voteper_SCparties = 3.5   if countryelection == 45
replace voteper_ASparties = 28 if countryelection == 45

replace voteper_EL_ASP = 1      if countryelection == 45
replace voteper_RL_ASP =.        if countryelection == 45
replace voteper_ER_ASP =.        if countryelection == 45
replace voteper_RR_ASP = 20.5       if countryelection == 45
replace voteper_GREEN_ASP =.     if countryelection == 45
replace voteper_PIRATE_ASP = 0.8     if countryelection == 45
replace voteper_MISC_POP_ASP = 5.7  if countryelection == 45
replace voteper_SEC_NAT_ASP = .   if countryelection == 45
replace voteper_REL_ASP =.       if countryelection == 45
replace voteper_OTHERR_ASP =.    if countryelection == 45
replace voteper_OTHERL_ASP = .    if countryelection == 45



******************************** CANADA ********************************************

***** Source:  Nohlen (2005) [1953-1993]
*              Elections Canada Website [1997-2015]




*1953*
replace string_PSparties = "Liberal (48.8), Prog Conservative (31)" if countryelection == 46
replace string_CPparties = "Other (3.5, Ind)" if countryelection == 46
replace string_SCparties = "NA" if countryelection == 46
replace string_ASparties = "Co-operative Commonwealth (OL, 11.3), Social Credit (OL, 5.4)" if countryelection == 46

replace voteper_PSparties = 79.8 if countryelection == 46
replace voteper_CPparties =  3.5 if countryelection == 46
replace voteper_SCparties =  0   if countryelection == 46
replace voteper_ASparties = 16.7 if countryelection == 46

replace voteper_EL_ASP = .      if countryelection == 46
replace voteper_RL_ASP =.        if countryelection == 46
replace voteper_ER_ASP =.        if countryelection == 46
replace voteper_RR_ASP = .       if countryelection == 46
replace voteper_GREEN_ASP =.     if countryelection == 46
replace voteper_PIRATE_ASP = .     if countryelection == 46
replace voteper_MISC_POP_ASP = .  if countryelection == 46
replace voteper_SEC_NAT_ASP = .   if countryelection == 46
replace voteper_REL_ASP =.       if countryelection == 46
replace voteper_OTHERR_ASP =.    if countryelection == 46
replace voteper_OTHERL_ASP = 16.7    if countryelection == 46

*1957*
replace string_PSparties = "Liberal (40.9), Prog Conservative (38.9)" if countryelection == 47
replace string_CPparties = "Other (2.8, Ind), Co-operative Commonwealth (LW, 10.7)" if countryelection == 47
replace string_SCparties = "NA" if countryelection == 47
replace string_ASparties = "Social Credit (OL, 6.6)" if countryelection == 47

replace voteper_PSparties = 79.8 if countryelection == 47
replace voteper_CPparties = 13.5 if countryelection == 47
replace voteper_SCparties =  0   if countryelection == 47
replace voteper_ASparties =  6.6 if countryelection == 47

replace voteper_EL_ASP = .      if countryelection == 47
replace voteper_RL_ASP =.        if countryelection == 47
replace voteper_ER_ASP =.        if countryelection == 47
replace voteper_RR_ASP = .       if countryelection == 47
replace voteper_GREEN_ASP =.     if countryelection == 47
replace voteper_PIRATE_ASP = .     if countryelection == 47
replace voteper_MISC_POP_ASP = .  if countryelection == 47
replace voteper_SEC_NAT_ASP = .   if countryelection == 47
replace voteper_REL_ASP =.       if countryelection == 47
replace voteper_OTHERR_ASP =.    if countryelection == 47
replace voteper_OTHERL_ASP = 6.6    if countryelection == 47

*1958*
replace string_PSparties = "Liberal (33.6), Prog Conservative (53.6)" if countryelection == 48
replace string_CPparties = "Other (0.7, Ind), Co-operative Commonwealth (LW, 9.5)" if countryelection == 48
replace string_SCparties = "NA" if countryelection == 48
replace string_ASparties = "Social Credit (OL, 2.6)" if countryelection == 48

replace voteper_PSparties = 87.2 if countryelection == 48
replace voteper_CPparties = 10.2  if countryelection == 48
replace voteper_SCparties =  0  if countryelection == 48
replace voteper_ASparties =  2.6 if countryelection == 48

replace voteper_EL_ASP = .      if countryelection == 48
replace voteper_RL_ASP =.        if countryelection == 48
replace voteper_ER_ASP =.        if countryelection == 48
replace voteper_RR_ASP = .       if countryelection == 48
replace voteper_GREEN_ASP =.     if countryelection == 48
replace voteper_PIRATE_ASP = .     if countryelection == 48
replace voteper_MISC_POP_ASP = .  if countryelection == 48
replace voteper_SEC_NAT_ASP = .   if countryelection == 48
replace voteper_REL_ASP =.       if countryelection == 48
replace voteper_OTHERR_ASP =.    if countryelection == 48
replace voteper_OTHERL_ASP = 2.6    if countryelection == 48

*1962*
replace string_PSparties = "Liberal (37.2), Prog Conservative (37.3)" if countryelection == 49
replace string_CPparties = "Other (0.4, Ind), New Democratic (LW, 13.5)" if countryelection == 49
replace string_SCparties = "NA" if countryelection == 49
replace string_ASparties = "Social Credit (OL, 11.7)" if countryelection == 49

replace voteper_PSparties = 74.5  if countryelection == 49
replace voteper_CPparties = 13.9 if countryelection == 49
replace voteper_SCparties =  0  if countryelection == 49
replace voteper_ASparties = 11.7 if countryelection == 49

replace voteper_EL_ASP = .      if countryelection == 49
replace voteper_RL_ASP =.        if countryelection == 49
replace voteper_ER_ASP =.        if countryelection == 49
replace voteper_RR_ASP = .       if countryelection == 49
replace voteper_GREEN_ASP =.     if countryelection == 49
replace voteper_PIRATE_ASP = .     if countryelection == 49
replace voteper_MISC_POP_ASP = .  if countryelection == 49
replace voteper_SEC_NAT_ASP = .   if countryelection == 49
replace voteper_REL_ASP =.       if countryelection == 49
replace voteper_OTHERR_ASP =.    if countryelection == 49
replace voteper_OTHERL_ASP = 11.7    if countryelection == 49

*1963*
replace string_PSparties = "Liberal (41.7), Prog Conservative (32.8)" if countryelection == 50
replace string_CPparties = "Other (0.4, Ind), New Democratic (13.1, LW)" if countryelection == 50
replace string_SCparties = "NA" if countryelection == 50
replace string_ASparties = "Social Credit (11.9, OL)" if countryelection == 50

replace voteper_PSparties = 74.5 if countryelection == 50
replace voteper_CPparties = 13.5  if countryelection == 50
replace voteper_SCparties =  0  if countryelection == 50
replace voteper_ASparties = 11.9 if countryelection == 50

replace voteper_EL_ASP = .      if countryelection == 50
replace voteper_RL_ASP =.        if countryelection == 50
replace voteper_ER_ASP =.        if countryelection == 50
replace voteper_RR_ASP = .       if countryelection == 50
replace voteper_GREEN_ASP =.     if countryelection == 50
replace voteper_PIRATE_ASP = .     if countryelection == 50
replace voteper_MISC_POP_ASP = .  if countryelection == 50
replace voteper_SEC_NAT_ASP = .   if countryelection == 50
replace voteper_REL_ASP =.       if countryelection == 50
replace voteper_OTHERR_ASP =.    if countryelection == 50
replace voteper_OTHERL_ASP = 11.9    if countryelection == 50

*1965*
replace string_PSparties = "Liberal (40.2), Prog Conservative (32.4)" if countryelection == 51
replace string_CPparties = "Other (1.2, Ind), New Democratic (17.9, LW)" if countryelection == 51
replace string_SCparties = "NA" if countryelection == 51
replace string_ASparties = "Social Credit (8.4, OL)" if countryelection == 51

replace voteper_PSparties = 72.6 if countryelection == 51
replace voteper_CPparties = 19.1 if countryelection == 51
replace voteper_SCparties =  0  if countryelection == 51
replace voteper_ASparties =  8.4 if countryelection == 51

replace voteper_EL_ASP = .      if countryelection == 51
replace voteper_RL_ASP =.        if countryelection == 51
replace voteper_ER_ASP =.        if countryelection == 51
replace voteper_RR_ASP = .       if countryelection == 51
replace voteper_GREEN_ASP =.     if countryelection == 51
replace voteper_PIRATE_ASP = .     if countryelection == 51
replace voteper_MISC_POP_ASP = .  if countryelection == 51
replace voteper_SEC_NAT_ASP = .   if countryelection == 51
replace voteper_REL_ASP =.       if countryelection == 51
replace voteper_OTHERR_ASP =.    if countryelection == 51
replace voteper_OTHERL_ASP = 8.4    if countryelection == 51

*1968*
replace string_PSparties = "Liberal (45.5), Prog Conservative (31.4)" if countryelection == 52
replace string_CPparties = "Other (1.6, Ind), New Democratic (17, LW)" if countryelection == 52
replace string_SCparties = "NA" if countryelection == 52
replace string_ASparties = "Social Credit (4.4, OL)" if countryelection == 52

replace voteper_PSparties = 76.9 if countryelection == 52
replace voteper_CPparties = 18.6  if countryelection == 52
replace voteper_SCparties =  0  if countryelection == 52
replace voteper_ASparties =  4.4 if countryelection == 52

replace voteper_EL_ASP = .      if countryelection == 52
replace voteper_RL_ASP =.        if countryelection == 52
replace voteper_ER_ASP =.        if countryelection == 52
replace voteper_RR_ASP = .       if countryelection == 52
replace voteper_GREEN_ASP =.     if countryelection == 52
replace voteper_PIRATE_ASP = .     if countryelection == 52
replace voteper_MISC_POP_ASP = .  if countryelection == 52
replace voteper_SEC_NAT_ASP = .   if countryelection == 52
replace voteper_REL_ASP =.       if countryelection == 52
replace voteper_OTHERR_ASP =.    if countryelection == 52
replace voteper_OTHERL_ASP = 4.4    if countryelection == 52

*1972*
replace string_PSparties = "Liberal (38.5), Prog Conservative (35)" if countryelection == 53
replace string_CPparties = "Other (1.2, Ind), New Democratic (17.7, LW)" if countryelection == 53
replace string_SCparties = "NA" if countryelection == 53
replace string_ASparties = "Social Credit (7.6, Other)" if countryelection == 53

replace voteper_PSparties =  73.5 if countryelection == 53
replace voteper_CPparties =  18.9  if countryelection == 53
replace voteper_SCparties =   0   if countryelection == 53
replace voteper_ASparties =   7.6 if countryelection == 53

replace voteper_EL_ASP = .      if countryelection == 53
replace voteper_RL_ASP =.        if countryelection == 53
replace voteper_ER_ASP =.        if countryelection == 53
replace voteper_RR_ASP = .       if countryelection == 53
replace voteper_GREEN_ASP =.     if countryelection == 53
replace voteper_PIRATE_ASP = .     if countryelection == 53
replace voteper_MISC_POP_ASP = .  if countryelection == 53
replace voteper_SEC_NAT_ASP = .   if countryelection == 53
replace voteper_REL_ASP =.       if countryelection == 53
replace voteper_OTHERR_ASP =.    if countryelection == 53
replace voteper_OTHERL_ASP = 7.6    if countryelection == 53

*1974*
replace string_PSparties = "Liberal (43.2), Prog Conservative (35.4), New Democratic (15.4, LW)" if countryelection == 54
replace string_CPparties = "Other (0.9, Ind)" if countryelection == 54
replace string_SCparties = "NA" if countryelection == 54
replace string_ASparties = "Social Credit (5.1, Other)" if countryelection == 54

replace voteper_PSparties = 94 if countryelection == 54
replace voteper_CPparties = 0.9  if countryelection == 54
replace voteper_SCparties = 0   if countryelection == 54
replace voteper_ASparties = 5.1 if countryelection == 54

replace voteper_EL_ASP = .      if countryelection == 54
replace voteper_RL_ASP =.        if countryelection == 54
replace voteper_ER_ASP =.        if countryelection == 54
replace voteper_RR_ASP = .       if countryelection == 54
replace voteper_GREEN_ASP =.     if countryelection == 54
replace voteper_PIRATE_ASP = .     if countryelection == 54
replace voteper_MISC_POP_ASP = .  if countryelection == 54
replace voteper_SEC_NAT_ASP = .   if countryelection == 54
replace voteper_REL_ASP =.       if countryelection == 54
replace voteper_OTHERR_ASP =.    if countryelection == 54
replace voteper_OTHERL_ASP = 5.1    if countryelection == 54

*1979*
replace string_PSparties = "Liberal (40.1), Prog Conservative (35.9), New Democratic (17.9, LW)" if countryelection == 55
replace string_CPparties = "Other (1.5, Ind)" if countryelection == 55
replace string_SCparties = "NA" if countryelection == 55
replace string_ASparties = "Social Credit (4.6, Other)" if countryelection == 55

replace voteper_PSparties = 93.9 if countryelection == 55
replace voteper_CPparties =  1.5 if countryelection == 55
replace voteper_SCparties =  0   if countryelection == 55
replace voteper_ASparties =  4.6 if countryelection == 55

replace voteper_EL_ASP = .      if countryelection == 55
replace voteper_RL_ASP =.        if countryelection == 55
replace voteper_ER_ASP =.        if countryelection == 55
replace voteper_RR_ASP = .       if countryelection == 55
replace voteper_GREEN_ASP =.     if countryelection == 55
replace voteper_PIRATE_ASP = .     if countryelection == 55
replace voteper_MISC_POP_ASP = .  if countryelection == 55
replace voteper_SEC_NAT_ASP = .   if countryelection == 55
replace voteper_REL_ASP =.       if countryelection == 55
replace voteper_OTHERR_ASP =.    if countryelection == 55
replace voteper_OTHERL_ASP = 4.6    if countryelection == 55

*1980*
replace string_PSparties = "Liberal (44.3), Prog Conservative (32.5), New Democratic (19.8, LW)" if countryelection == 56
replace string_CPparties = "NA" if countryelection == 56
replace string_SCparties = "NA" if countryelection == 56
replace string_ASparties = "Social Credit (3.4, Other)" if countryelection == 56

replace voteper_PSparties =  96.6 if countryelection == 56
replace voteper_CPparties =  0 if countryelection == 56
replace voteper_SCparties =  0  if countryelection == 56
replace voteper_ASparties =  3.4 if countryelection == 56

replace voteper_EL_ASP = .      if countryelection == 56
replace voteper_RL_ASP =.        if countryelection == 56
replace voteper_ER_ASP =.        if countryelection == 56
replace voteper_RR_ASP = .       if countryelection == 56
replace voteper_GREEN_ASP =.     if countryelection == 56
replace voteper_PIRATE_ASP = .     if countryelection == 56
replace voteper_MISC_POP_ASP = .  if countryelection == 56
replace voteper_SEC_NAT_ASP = .   if countryelection == 56
replace voteper_REL_ASP =.       if countryelection == 56
replace voteper_OTHERR_ASP =.    if countryelection == 56
replace voteper_OTHERL_ASP = 3.4    if countryelection == 56

*1984*
replace string_PSparties = "Liberal (28), Prog Conservative (50), New Democratic (18.8, LW)" if countryelection == 57
replace string_CPparties = "Other (3, Ind)" if countryelection == 57
replace string_SCparties = "NA" if countryelection == 57
replace string_ASparties = "Green (0.2, Green)" if countryelection == 57

replace voteper_PSparties = 96.8 if countryelection == 57
replace voteper_CPparties = 3  if countryelection == 57
replace voteper_SCparties = 0   if countryelection == 57
replace voteper_ASparties = 0.2 if countryelection == 57

replace voteper_EL_ASP = .      if countryelection == 57
replace voteper_RL_ASP =.        if countryelection == 57
replace voteper_ER_ASP =.        if countryelection == 57
replace voteper_RR_ASP = .       if countryelection == 57
replace voteper_GREEN_ASP = 0.2     if countryelection == 57
replace voteper_PIRATE_ASP = .     if countryelection == 57
replace voteper_MISC_POP_ASP = .  if countryelection == 57
replace voteper_SEC_NAT_ASP = .   if countryelection == 57
replace voteper_REL_ASP =.       if countryelection == 57
replace voteper_OTHERR_ASP =.    if countryelection == 57
replace voteper_OTHERL_ASP = .    if countryelection == 57

*1988*
replace string_PSparties = "Liberal (31.9), Prog Conservative (43), New Democratic (20.4, LW)" if countryelection == 58
replace string_CPparties = "Other (2.2, Ind)" if countryelection == 58
replace string_SCparties = "NA" if countryelection == 58
replace string_ASparties = "Green (0.4, Green), Reform Party (2.1, RR)" if countryelection == 58

replace voteper_PSparties = 95.3 if countryelection == 58
replace voteper_CPparties =  2.2 if countryelection == 58
replace voteper_SCparties =  0   if countryelection == 58
replace voteper_ASparties =  2.5 if countryelection == 58

replace voteper_EL_ASP = .      if countryelection == 58
replace voteper_RL_ASP =.        if countryelection == 58
replace voteper_ER_ASP =.        if countryelection == 58
replace voteper_RR_ASP = 2.1       if countryelection == 58
replace voteper_GREEN_ASP = 0.4     if countryelection == 58
replace voteper_PIRATE_ASP = .     if countryelection == 58
replace voteper_MISC_POP_ASP = .  if countryelection == 58
replace voteper_SEC_NAT_ASP = .   if countryelection == 58
replace voteper_REL_ASP =.       if countryelection == 58
replace voteper_OTHERR_ASP =.    if countryelection == 58
replace voteper_OTHERL_ASP = .    if countryelection == 58

*1993*
replace string_PSparties = "Liberal (41.3), Prog Conservative (16), New Democratic (6.9, LW)" if countryelection == 59
replace string_CPparties = "Other (3.3, Ind)" if countryelection == 59
replace string_SCparties = "NA" if countryelection == 59
replace string_ASparties = "Green (0.2, Green), Reform Party (18.7, RW), Bloc Qubecois (13.5, Sec)" if countryelection == 59

replace voteper_PSparties = 64.2 if countryelection == 59
replace voteper_CPparties =  3.3  if countryelection == 59
replace voteper_SCparties =  0  if countryelection == 59
replace voteper_ASparties = 32.4 if countryelection == 59

replace voteper_EL_ASP = .      if countryelection == 59
replace voteper_RL_ASP =.        if countryelection == 59
replace voteper_ER_ASP =.        if countryelection == 59
replace voteper_RR_ASP = 18.7       if countryelection == 59
replace voteper_GREEN_ASP = 0.2     if countryelection == 59
replace voteper_PIRATE_ASP = .     if countryelection == 59
replace voteper_MISC_POP_ASP = .  if countryelection == 59
replace voteper_SEC_NAT_ASP = 13.5   if countryelection == 59
replace voteper_REL_ASP =.       if countryelection == 59
replace voteper_OTHERR_ASP =.    if countryelection == 59
replace voteper_OTHERL_ASP = .    if countryelection == 59

*1997*
replace string_PSparties = "Liberal (38.5), Prog Conservative (18.8), New Democratic (11, LW)" if countryelection == 60
replace string_CPparties = "Other (0.8, Ind)" if countryelection == 60
replace string_SCparties = "NA" if countryelection == 60
replace string_ASparties = "Green (0.4, Green), Reform Party (19.4, RW), Bloc Qubecois (10.7, Sec), ML Party of Canada (0.1, EL), Natural Law Party (0.3, Rel)" if countryelection == 60

replace voteper_PSparties = 68.3 if countryelection == 60
replace voteper_CPparties = 1.1  if countryelection == 60
replace voteper_SCparties = 0   if countryelection == 60
replace voteper_ASparties = 30.9 if countryelection == 60

replace voteper_EL_ASP = 0.1      if countryelection == 60
replace voteper_RL_ASP =.        if countryelection == 60
replace voteper_ER_ASP =.        if countryelection == 60
replace voteper_RR_ASP = 19.4       if countryelection == 60
replace voteper_GREEN_ASP = 0.4     if countryelection == 60
replace voteper_PIRATE_ASP = .     if countryelection == 60
replace voteper_MISC_POP_ASP = .  if countryelection == 60
replace voteper_SEC_NAT_ASP = 10.7   if countryelection == 60
replace voteper_REL_ASP = 0.3       if countryelection == 60
replace voteper_OTHERR_ASP =.    if countryelection == 60
replace voteper_OTHERL_ASP = .    if countryelection == 60

*2000*
replace string_PSparties = "Liberal (40.8), Prog Conservative (12.2), New Democratic (8.5, LW)" if countryelection == 61
replace string_CPparties = "Other (1.3, Ind)" if countryelection == 61
replace string_SCparties = "NA" if countryelection == 61
replace string_ASparties = "Reform Alliance (25.5, RR), Green (0.8, Green), Bloc Qubecois (10.7, Sec), Comm/ML Party (EL, 0.2)" if countryelection == 61

replace voteper_PSparties =  61.5 if countryelection == 61
replace voteper_CPparties =   1.3 if countryelection == 61
replace voteper_SCparties =   0   if countryelection == 61
replace voteper_ASparties =  37.2 if countryelection == 61

replace voteper_EL_ASP = 0.2      if countryelection == 61
replace voteper_RL_ASP =.        if countryelection == 61
replace voteper_ER_ASP =.        if countryelection == 61
replace voteper_RR_ASP = 25.5       if countryelection == 61
replace voteper_GREEN_ASP = 0.8     if countryelection == 61
replace voteper_PIRATE_ASP = .     if countryelection == 61
replace voteper_MISC_POP_ASP = .  if countryelection == 61
replace voteper_SEC_NAT_ASP = 10.7   if countryelection == 61
replace voteper_REL_ASP =.       if countryelection == 61
replace voteper_OTHERR_ASP =.    if countryelection == 61
replace voteper_OTHERL_ASP = .    if countryelection == 61

*2004*
replace string_PSparties = "Liberal (36.7), Conservative Party (29.6), New Democratic (15.7, LW)" if countryelection == 62
replace string_CPparties = "Other (1.2, Ind), Green (4.3, Green)" if countryelection == 62
replace string_SCparties = "NA" if countryelection == 62
replace string_ASparties = "Bloc Qubecois (12.4, Sec), ML Party (0.1, EL)" if countryelection == 62

replace voteper_PSparties = 82 if countryelection == 62
replace voteper_CPparties =  5.5  if countryelection == 62
replace voteper_SCparties =  0  if countryelection == 62
replace voteper_ASparties = 12.5 if countryelection == 62

replace voteper_EL_ASP = 0.1      if countryelection == 62
replace voteper_RL_ASP =.        if countryelection == 62
replace voteper_ER_ASP =.        if countryelection == 62
replace voteper_RR_ASP = .       if countryelection == 62
replace voteper_GREEN_ASP = .     if countryelection == 62
replace voteper_PIRATE_ASP = .     if countryelection == 62
replace voteper_MISC_POP_ASP = .  if countryelection == 62
replace voteper_SEC_NAT_ASP = 12.4   if countryelection == 62
replace voteper_REL_ASP =.       if countryelection == 62
replace voteper_OTHERR_ASP =.    if countryelection == 62
replace voteper_OTHERL_ASP = .    if countryelection == 62

*2006*
replace string_PSparties = "Liberal (30.2), Conservative Party (36.3), New Democratic (17.5, LW)" if countryelection == 63
replace string_CPparties = "Other (1, Ind), Green (4.5, Green)" if countryelection == 63
replace string_SCparties = "NA" if countryelection == 63
replace string_ASparties = "Bloc Qubecois (10.5, Sec), ML Party (0.1, EL)" if countryelection == 63

replace voteper_PSparties = 84 if countryelection == 63
replace voteper_CPparties =  5.5 if countryelection == 63
replace voteper_SCparties =  0  if countryelection == 63
replace voteper_ASparties = 10.6 if countryelection == 63

replace voteper_EL_ASP = 0.1      if countryelection == 63
replace voteper_RL_ASP =.        if countryelection == 63
replace voteper_ER_ASP =.        if countryelection == 63
replace voteper_RR_ASP = .       if countryelection == 63
replace voteper_GREEN_ASP =.     if countryelection == 63
replace voteper_PIRATE_ASP = .     if countryelection == 63
replace voteper_MISC_POP_ASP = .  if countryelection == 63
replace voteper_SEC_NAT_ASP = 10.5   if countryelection == 63
replace voteper_REL_ASP =.       if countryelection == 63
replace voteper_OTHERR_ASP =.    if countryelection == 63
replace voteper_OTHERL_ASP = .    if countryelection == 63

*2008*
replace string_PSparties = "Liberal (26.3), Conservative Party (37.7), New Democratic (18.2, LW)" if countryelection == 64
replace string_CPparties = "Other (1.1, Ind), Green (6.8, Green)" if countryelection == 64
replace string_SCparties = "NA" if countryelection == 64
replace string_ASparties = "Bloc Qubecois (10, Sec), ML Party of Canada (0.1, EL)" if countryelection == 64

replace voteper_PSparties = 82.2 if countryelection == 64
replace voteper_CPparties =  7.9 if countryelection == 64
replace voteper_SCparties =  0   if countryelection == 64
replace voteper_ASparties = 10.1 if countryelection == 64

replace voteper_EL_ASP = 0.1     if countryelection == 64
replace voteper_RL_ASP =.        if countryelection == 64
replace voteper_ER_ASP =.        if countryelection == 64
replace voteper_RR_ASP = .       if countryelection == 64
replace voteper_GREEN_ASP =.     if countryelection == 64
replace voteper_PIRATE_ASP = .     if countryelection == 64
replace voteper_MISC_POP_ASP = .  if countryelection == 64
replace voteper_SEC_NAT_ASP = 10   if countryelection == 64
replace voteper_REL_ASP =.       if countryelection == 64
replace voteper_OTHERR_ASP =.    if countryelection == 64
replace voteper_OTHERL_ASP = .    if countryelection == 64

*2011*
replace string_PSparties = "Liberal (18.9), Conservative Party (39.6), New Democratic (30.6, LW)" if countryelection == 65
replace string_CPparties = "Other (0.8, Ind), Green (3.9, Green)" if countryelection == 65
replace string_SCparties = "NA" if countryelection == 65
replace string_ASparties = "Bloc Qubecois (6.1, Sec), ML Party (0.1, EL)" if countryelection == 65

replace voteper_PSparties = 89.1 if countryelection == 65
replace voteper_CPparties =  4.7 if countryelection == 65
replace voteper_SCparties =  0   if countryelection == 65
replace voteper_ASparties =  6.2 if countryelection == 65

replace voteper_EL_ASP = 0.1     if countryelection == 65
replace voteper_RL_ASP =.        if countryelection == 65
replace voteper_ER_ASP =.        if countryelection == 65
replace voteper_RR_ASP = .       if countryelection == 65
replace voteper_GREEN_ASP =.     if countryelection == 65
replace voteper_PIRATE_ASP = .     if countryelection == 65
replace voteper_MISC_POP_ASP = .  if countryelection == 65
replace voteper_SEC_NAT_ASP = 6.1   if countryelection == 65
replace voteper_REL_ASP =.       if countryelection == 65
replace voteper_OTHERR_ASP =.    if countryelection == 65
replace voteper_OTHERL_ASP = .    if countryelection == 65

*2015*
replace string_PSparties = "Liberal (39.5), Conservative Party (31.9), New Democratic (19.7, LW)" if countryelection == 66
replace string_CPparties = "Other (0.7, Ind), Green (3.4, Green)" if countryelection == 66
replace string_SCparties = "NA" if countryelection == 66
replace string_ASparties = "Bloc Qubecois (4.7, Sec), ML Party (0.1, EL)" if countryelection == 66

replace voteper_PSparties = 91.1 if countryelection == 66
replace voteper_CPparties =  4.1 if countryelection == 66
replace voteper_SCparties =  0  if countryelection == 66
replace voteper_ASparties =  4.8 if countryelection == 66

replace voteper_EL_ASP = 0.1      if countryelection == 66
replace voteper_RL_ASP =.        if countryelection == 66
replace voteper_ER_ASP =.        if countryelection == 66
replace voteper_RR_ASP = .       if countryelection == 66
replace voteper_GREEN_ASP =.     if countryelection == 66
replace voteper_PIRATE_ASP = .     if countryelection == 66
replace voteper_MISC_POP_ASP = .  if countryelection == 66
replace voteper_SEC_NAT_ASP = 4.7   if countryelection == 66
replace voteper_REL_ASP =.       if countryelection == 66
replace voteper_OTHERR_ASP =.    if countryelection == 66
replace voteper_OTHERL_ASP = .    if countryelection == 66



**************************************************************** DENMARK ********************************************************************

***** Source:  Nohlen and Stover (2010) [1950-2007]
*              Statistics Denmark Website [2011-2015]


*1950* 
replace string_PSparties = "Social Democrat (39.6), Venstre (21.3), Conservative People's Party (17.8), Social Liberal (8.2)" if countryelection == 67
replace string_CPparties = "Justice Party (8.2, Other), Schlewsig Party (Reg, 0.3)" if countryelection == 67
replace string_SCparties = "NA" if countryelection == 67
replace string_ASparties = "Communist (4.6, EL)" if countryelection == 67

replace voteper_PSparties = 86.9 if countryelection == 67
replace voteper_CPparties = 8.5  if countryelection == 67
replace voteper_SCparties = 0   if countryelection == 67
replace voteper_ASparties = 4.6 if countryelection == 67

replace voteper_EL_ASP = 4.6      if countryelection == 67
replace voteper_RL_ASP =.        if countryelection == 67
replace voteper_ER_ASP =.        if countryelection == 67
replace voteper_RR_ASP = .       if countryelection == 67
replace voteper_GREEN_ASP =.     if countryelection == 67
replace voteper_PIRATE_ASP = .     if countryelection == 67
replace voteper_MISC_POP_ASP = .  if countryelection == 67
replace voteper_SEC_NAT_ASP = .   if countryelection == 67
replace voteper_REL_ASP =.       if countryelection == 67
replace voteper_OTHERR_ASP =.    if countryelection == 67
replace voteper_OTHERL_ASP = .    if countryelection == 67

*1953a* 
replace string_PSparties = "Social Democrat (40.4), Venstre (22.1), Conservative People's Party (17.3), Social Liberal (8.6)" if countryelection == 68
replace string_CPparties = "Justice Party (5.6, Other), Schlewsig Party (Reg, 0.4)" if countryelection == 68
replace string_SCparties = "NA" if countryelection == 68
replace string_ASparties = "Communist (4.8, Com), Danish Unity (0.8, ER)" if countryelection == 68

replace voteper_PSparties = 88.4 if countryelection == 68
replace voteper_CPparties =  6   if countryelection == 68
replace voteper_SCparties =  0  if countryelection == 68
replace voteper_ASparties =  5.6 if countryelection == 68

replace voteper_EL_ASP = 4.8      if countryelection == 68
replace voteper_RL_ASP =.        if countryelection == 68
replace voteper_ER_ASP = 0.8        if countryelection == 68
replace voteper_RR_ASP = .       if countryelection == 68
replace voteper_GREEN_ASP =.     if countryelection == 68
replace voteper_PIRATE_ASP = .     if countryelection == 68
replace voteper_MISC_POP_ASP = .  if countryelection == 68
replace voteper_SEC_NAT_ASP = .   if countryelection == 68
replace voteper_REL_ASP =.       if countryelection == 68
replace voteper_OTHERR_ASP =.    if countryelection == 68
replace voteper_OTHERL_ASP = .    if countryelection == 68

*1953b* 
replace string_PSparties = "Social Democrat (41.3), Venstre (23.1), Conservative People's Party (16.8), Social Liberal (7.8)" if countryelection == 69
replace string_CPparties = "Justice Party (3.5, Other), Schlewsig Party (Reg, 0.5), Uafh (2.7, Lib)" if countryelection == 69
replace string_SCparties = "NA" if countryelection == 69
replace string_ASparties = "Communist (4.3, Com)" if countryelection == 69

replace voteper_PSparties =  89 if countryelection == 69
replace voteper_CPparties =  6.7  if countryelection == 69
replace voteper_SCparties =   0 if countryelection == 69
replace voteper_ASparties =   4.3 if countryelection == 69

replace voteper_EL_ASP = 4.3      if countryelection == 69
replace voteper_RL_ASP =.        if countryelection == 69
replace voteper_ER_ASP =.        if countryelection == 69
replace voteper_RR_ASP = .       if countryelection == 69
replace voteper_GREEN_ASP =.     if countryelection == 69
replace voteper_PIRATE_ASP = .     if countryelection == 69
replace voteper_MISC_POP_ASP = .  if countryelection == 69
replace voteper_SEC_NAT_ASP = .   if countryelection == 69
replace voteper_REL_ASP =.       if countryelection == 69
replace voteper_OTHERR_ASP =.    if countryelection == 69
replace voteper_OTHERL_ASP = .    if countryelection == 69

*1957* 
replace string_PSparties = "Social Democrat (39.4), Venstre (25.1), Conservative People's Party (16.6), Social Liberal (7.8)" if countryelection == 70
replace string_CPparties = "Justice Party (5.3, Other), Schlewsig Party (Reg, 0.4), Uafh (2.3, Lib)" if countryelection == 70
replace string_SCparties = "NA" if countryelection == 70
replace string_ASparties = "Communist (3.1, Com)" if countryelection == 70

replace voteper_PSparties = 88.9 if countryelection == 70
replace voteper_CPparties = 8  if countryelection == 70
replace voteper_SCparties = 0   if countryelection == 70
replace voteper_ASparties = 3.1 if countryelection == 70

replace voteper_EL_ASP = 3.1      if countryelection == 70
replace voteper_RL_ASP =.        if countryelection == 70
replace voteper_ER_ASP =.        if countryelection == 70
replace voteper_RR_ASP = .       if countryelection == 70
replace voteper_GREEN_ASP =.     if countryelection == 70
replace voteper_PIRATE_ASP = .     if countryelection == 70
replace voteper_MISC_POP_ASP = .  if countryelection == 70
replace voteper_SEC_NAT_ASP = .   if countryelection == 70
replace voteper_REL_ASP =.       if countryelection == 70
replace voteper_OTHERR_ASP =.    if countryelection == 70
replace voteper_OTHERL_ASP = .    if countryelection == 70

*1960* 
replace string_PSparties = "Social Democrat (42.1), Venstre (21.1), Conservative People's Party (17.9), Justice Party (2.2, Other), Social Liberal (5.8)" if countryelection == 71
replace string_CPparties = "Schlewsig Party (Reg, 0.4), Uafh (3.3, Lib)" if countryelection == 71
replace string_SCparties = "NA" if countryelection == 71
replace string_ASparties = "Communist (1.1, Com), Socialist People's Party (6.1, RL)" if countryelection == 71

replace voteper_PSparties =  89.1 if countryelection == 71
replace voteper_CPparties =   3.7 if countryelection == 71
replace voteper_SCparties =   0 if countryelection == 71
replace voteper_ASparties =   7.2 if countryelection == 71

replace voteper_EL_ASP = 1.1      if countryelection == 71
replace voteper_RL_ASP = 6.1        if countryelection == 71
replace voteper_ER_ASP =.        if countryelection == 71
replace voteper_RR_ASP = .       if countryelection == 71
replace voteper_GREEN_ASP =.     if countryelection == 71
replace voteper_PIRATE_ASP = .     if countryelection == 71
replace voteper_MISC_POP_ASP = .  if countryelection == 71
replace voteper_SEC_NAT_ASP = .   if countryelection == 71
replace voteper_REL_ASP =.       if countryelection == 71
replace voteper_OTHERR_ASP =.    if countryelection == 71
replace voteper_OTHERL_ASP = .    if countryelection == 71

*1964* 
replace string_PSparties = "Social Democrat (41.9), Venstre (20.8), Conservative People's Party (20.1), Justice Party (1.3, Other), Social Liberal (5.3)" if countryelection == 72
replace string_CPparties = "Schlewsig Party (Reg, 0.4), Uafh (2.5, Lib)" if countryelection == 72
replace string_SCparties = "NA" if countryelection == 72
replace string_ASparties = "Communist (1.2, Com), Danish Unity (0.4, ER), Socialist People's Party (5.8, RL), Peace, People Politics (0.3, OL)" if countryelection == 72

replace voteper_PSparties = 89.4 if countryelection == 72
replace voteper_CPparties =  2.9 if countryelection == 72
replace voteper_SCparties =  0  if countryelection == 72
replace voteper_ASparties =  7.7 if countryelection == 72

replace voteper_EL_ASP = 1.2      if countryelection == 72
replace voteper_RL_ASP = 5.8        if countryelection == 72
replace voteper_ER_ASP = 0.4        if countryelection == 72
replace voteper_RR_ASP = .       if countryelection == 72
replace voteper_GREEN_ASP =.     if countryelection == 72
replace voteper_PIRATE_ASP = .     if countryelection == 72
replace voteper_MISC_POP_ASP = .  if countryelection == 72
replace voteper_SEC_NAT_ASP = .   if countryelection == 72
replace voteper_REL_ASP =.       if countryelection == 72
replace voteper_OTHERR_ASP =.    if countryelection == 72
replace voteper_OTHERL_ASP = 0.3    if countryelection == 72

*1966* 
replace string_PSparties = "Social Democrat (38.2), Venstre (19.3), Conservative People's Party (18.7), Justice Party (0.7, Other), Social Liberal (7.3)" if countryelection == 73
replace string_CPparties = "Liberal Centre (2.5, Lib), Uafh (1.6, Lib)" if countryelection == 73
replace string_SCparties = "NA" if countryelection == 73
replace string_ASparties = "Communist (0.8, Com), Socialist People's Party (10.9, RL)" if countryelection == 73

replace voteper_PSparties = 84.2 if countryelection == 73
replace voteper_CPparties =  4.1 if countryelection == 73
replace voteper_SCparties =  0  if countryelection == 73
replace voteper_ASparties = 11.7 if countryelection == 73

replace voteper_EL_ASP = 0.8      if countryelection == 73
replace voteper_RL_ASP = 10.9        if countryelection == 73
replace voteper_ER_ASP =.        if countryelection == 73
replace voteper_RR_ASP = .       if countryelection == 73
replace voteper_GREEN_ASP =.     if countryelection == 73
replace voteper_PIRATE_ASP = .     if countryelection == 73
replace voteper_MISC_POP_ASP = .  if countryelection == 73
replace voteper_SEC_NAT_ASP = .   if countryelection == 73
replace voteper_REL_ASP =.       if countryelection == 73
replace voteper_OTHERR_ASP =.    if countryelection == 73
replace voteper_OTHERL_ASP = .    if countryelection == 73

*1968* 
replace string_PSparties = "Social Democrat (34.2), Venstre (18.6), Conservative People's Party (20.4), Justice Party (0.7, Other), Social Liberal (15)" if countryelection == 74
replace string_CPparties = "Liberal Centre (1.3, Lib), Uafh (0.5, Lib), Schleswig Party (0.2, Reg)" if countryelection == 74
replace string_SCparties = "Socialist People's Party (6.1, RL)" if countryelection == 74
replace string_ASparties = "Communist (1, Com), Left Socialists (2, Com)" if countryelection == 74

replace voteper_PSparties = 88.9 if countryelection == 74
replace voteper_CPparties =  2 if countryelection == 74
replace voteper_SCparties =  6.1  if countryelection == 74
replace voteper_ASparties =  3  if countryelection == 74

replace voteper_EL_ASP = 3      if countryelection == 74
replace voteper_RL_ASP =.        if countryelection == 74
replace voteper_ER_ASP =.        if countryelection == 74
replace voteper_RR_ASP = .       if countryelection == 74
replace voteper_GREEN_ASP =.     if countryelection == 74
replace voteper_PIRATE_ASP = .     if countryelection == 74
replace voteper_MISC_POP_ASP = .  if countryelection == 74
replace voteper_SEC_NAT_ASP = .   if countryelection == 74
replace voteper_REL_ASP =.       if countryelection == 74
replace voteper_OTHERR_ASP =.    if countryelection == 74
replace voteper_OTHERL_ASP = .    if countryelection == 74

*1971* 
replace string_PSparties = "Social Democrat (37.3), Venstre (15.6), Conservative People's Party (16.7), Social Liberal (14.4), Justice Party (1.7, Other), " if countryelection == 75
replace string_CPparties = "Schleswig Party (0.2, Reg), Christian People's (2, Rel)" if countryelection == 75
replace string_SCparties = "Socialist People's Party (9.1, RL)" if countryelection == 75
replace string_ASparties = "Communist (1.4, Com), Left Socialists (1.6, Com)" if countryelection == 75

replace voteper_PSparties =  85.7 if countryelection == 75
replace voteper_CPparties =   2.2 if countryelection == 75
replace voteper_SCparties =   9.1  if countryelection == 75
replace voteper_ASparties =   3  if countryelection == 75

replace voteper_EL_ASP = 3      if countryelection == 75
replace voteper_RL_ASP =.        if countryelection == 75
replace voteper_ER_ASP =.        if countryelection == 75
replace voteper_RR_ASP = .       if countryelection == 75
replace voteper_GREEN_ASP =.     if countryelection == 75
replace voteper_PIRATE_ASP = .     if countryelection == 75
replace voteper_MISC_POP_ASP = .  if countryelection == 75
replace voteper_SEC_NAT_ASP = .   if countryelection == 75
replace voteper_REL_ASP =.       if countryelection == 75
replace voteper_OTHERR_ASP =.    if countryelection == 75
replace voteper_OTHERL_ASP = .    if countryelection == 75

*1973*
replace string_PSparties = "Social Democrat (25.6), Venstre (12.3), Conservative People's Party (9.2), Social Liberal (11.2), Justice Party (2.9, Other), " if countryelection == 76
replace string_CPparties = "Christian People's (4, Rel), Centre Democrats (7.8, RW)" if countryelection == 76
replace string_SCparties = "Socialist People's Party (6, RL)" if countryelection == 76
replace string_ASparties = "Communist (3.6, Com), Left Socialists (1.5, Com), Progress Party (15.9, OR)" if countryelection == 76

replace voteper_PSparties = 61.2 if countryelection == 76
replace voteper_CPparties = 11.8 if countryelection == 76
replace voteper_SCparties =  6  if countryelection == 76
replace voteper_ASparties = 21 if countryelection == 76

replace voteper_EL_ASP = 5.1      if countryelection == 76
replace voteper_RL_ASP =.        if countryelection == 76
replace voteper_ER_ASP =.        if countryelection == 76
replace voteper_RR_ASP = .       if countryelection == 76
replace voteper_GREEN_ASP =.     if countryelection == 76
replace voteper_PIRATE_ASP = .     if countryelection == 76
replace voteper_MISC_POP_ASP = .  if countryelection == 76
replace voteper_SEC_NAT_ASP = .   if countryelection == 76
replace voteper_REL_ASP =.       if countryelection == 76
replace voteper_OTHERR_ASP = 15.9    if countryelection == 76
replace voteper_OTHERL_ASP = .    if countryelection == 76

*1975*
replace string_PSparties = "Social Democrat (29.9), Venstre (23.3), Conservative People's Party (5.5), Social Liberal (7.1), Justice Party (1.8, Other), " if countryelection == 77
replace string_CPparties = "Christian People's (5.3, Rel), Centre Democrats (2.2, RW)" if countryelection == 77
replace string_SCparties = "Socialist People's Party (5, RL)" if countryelection == 77
replace string_ASparties = "Communist (4.2, Com), Left Socialists (2.1, Com), Progress Party (13.6, OR)" if countryelection == 77

replace voteper_PSparties = 67.6 if countryelection == 77
replace voteper_CPparties =  7.5 if countryelection == 77
replace voteper_SCparties =  5  if countryelection == 77
replace voteper_ASparties = 19.9 if countryelection == 77

replace voteper_EL_ASP = 6.3      if countryelection == 77
replace voteper_RL_ASP =.        if countryelection == 77
replace voteper_ER_ASP =.        if countryelection == 77
replace voteper_RR_ASP = .       if countryelection == 77
replace voteper_GREEN_ASP =.     if countryelection == 77
replace voteper_PIRATE_ASP = .     if countryelection == 77
replace voteper_MISC_POP_ASP = .  if countryelection == 77
replace voteper_SEC_NAT_ASP = .   if countryelection == 77
replace voteper_REL_ASP =.       if countryelection == 77
replace voteper_OTHERR_ASP = 13.6    if countryelection == 77
replace voteper_OTHERL_ASP = .    if countryelection == 77

*1977*
replace string_PSparties = "Social Democrat (37), Venstre (12), Conservative People's Party (8.5), Social Liberal (3.6), Justice Party (3.3, Other), " if countryelection == 78
replace string_CPparties = "Christian People's (3.4, Rel), Centre Democrats (6.4, RW), Pensioner (0.9, Pens)" if countryelection == 78
replace string_SCparties = "Socialist People's Party (3.9, RL)" if countryelection == 78
replace string_ASparties = "Communist (3.7, Com), Left Socialists (2.7, Com), Progress Party (14.6, Libertarian)" if countryelection == 78

replace voteper_PSparties = 64.4 if countryelection == 78
replace voteper_CPparties = 10.7 if countryelection == 78
replace voteper_SCparties =  3.9  if countryelection == 78
replace voteper_ASparties = 21.0 if countryelection == 78

replace voteper_EL_ASP = .      if countryelection == 78
replace voteper_RL_ASP =.        if countryelection == 78
replace voteper_ER_ASP = 6.4        if countryelection == 78
replace voteper_RR_ASP = .       if countryelection == 78
replace voteper_GREEN_ASP =.     if countryelection == 78
replace voteper_PIRATE_ASP = .     if countryelection == 78
replace voteper_MISC_POP_ASP = .  if countryelection == 78
replace voteper_SEC_NAT_ASP = .   if countryelection == 78
replace voteper_REL_ASP =.       if countryelection == 78
replace voteper_OTHERR_ASP = 14.6   if countryelection == 78
replace voteper_OTHERL_ASP = .    if countryelection == 78

*1979*
replace string_PSparties = "Social Democrat (38.3), Venstre (12.5), Conservative People's Party (12.5), Social Liberal (5.4), Justice Party (2.6, Other), " if countryelection == 79
replace string_CPparties = "Christian People's (2.6, Rel), Centre Democrats (3.2, RW)" if countryelection == 79
replace string_SCparties = "Socialist People's Party (5.9, RL)" if countryelection == 79
replace string_ASparties = "Communist (1.9, Com), Workers' Party (0.4, Com), Left Socialists (3.7, Com), Progress Party (11, OR)" if countryelection == 79

replace voteper_PSparties = 71.3 if countryelection == 79
replace voteper_CPparties =  5.8  if countryelection == 79
replace voteper_SCparties =  5.9  if countryelection == 79
replace voteper_ASparties = 17  if countryelection == 79

replace voteper_EL_ASP = 6      if countryelection == 79
replace voteper_RL_ASP =.        if countryelection == 79
replace voteper_ER_ASP =.        if countryelection == 79
replace voteper_RR_ASP = .       if countryelection == 79
replace voteper_GREEN_ASP =.     if countryelection == 79
replace voteper_PIRATE_ASP = .     if countryelection == 79
replace voteper_MISC_POP_ASP = .  if countryelection == 79
replace voteper_SEC_NAT_ASP = .   if countryelection == 79
replace voteper_REL_ASP =.       if countryelection == 79
replace voteper_OTHERR_ASP = 11    if countryelection == 79
replace voteper_OTHERL_ASP = .    if countryelection == 79

*1981*
replace string_PSparties = "Social Democrat (32.9), Venstre (11.3), Conservative People's Party (14.5), Social Liberal (5.1), Justice Party (1.4, Other), " if countryelection == 80
replace string_CPparties = "Christian People's (2.3, Rel), Centre Democrats (8.3, RW)" if countryelection == 80
replace string_SCparties = "Socialist People's Party (11.3, RL)" if countryelection == 80
replace string_ASparties = "Communist (1.1, Com), Workers' Party/Int Socialists (0.2, Com), Left Socialists (2.7, Com), Progress Party (8.9, Libertarian)" if countryelection == 80

replace voteper_PSparties = 65.2 if countryelection == 80
replace voteper_CPparties = 10.6  if countryelection == 80
replace voteper_SCparties = 11.3   if countryelection == 80
replace voteper_ASparties = 12.9 if countryelection == 80

replace voteper_EL_ASP = 4      if countryelection == 80
replace voteper_RL_ASP =.        if countryelection == 80
replace voteper_ER_ASP =.        if countryelection == 80
replace voteper_RR_ASP = .       if countryelection == 80
replace voteper_GREEN_ASP =.     if countryelection == 80
replace voteper_PIRATE_ASP = .     if countryelection == 80
replace voteper_MISC_POP_ASP = .  if countryelection == 80
replace voteper_SEC_NAT_ASP = .   if countryelection == 80
replace voteper_REL_ASP =.       if countryelection == 80
replace voteper_OTHERR_ASP = 8.9    if countryelection == 80
replace voteper_OTHERL_ASP = .    if countryelection == 80

*1984*
replace string_PSparties = "Social Democrat (31.6), Venstre (12.1), Conservative People's Party (23.4), Social Liberal (5.5), Justice Party (1.5, Other), " if countryelection == 81
replace string_CPparties = "Christian People's (2.7, Rel), Centre Democrats (4.6, RW)" if countryelection == 81
replace string_SCparties = "Socialist People's Party (11.5, RL)" if countryelection == 81
replace string_ASparties = "Communist (0.7, Com), Int Socialists (0.1, Com), Left Socialists (2.7, Com), Progress Party (3.6, Libertar)" if countryelection == 81

replace voteper_PSparties = 74.1 if countryelection == 81
replace voteper_CPparties = 7.3  if countryelection == 81
replace voteper_SCparties = 11.5   if countryelection == 81
replace voteper_ASparties = 7.1 if countryelection == 81

replace voteper_EL_ASP = 3.5      if countryelection == 81
replace voteper_RL_ASP =.        if countryelection == 81
replace voteper_ER_ASP =.        if countryelection == 81
replace voteper_RR_ASP = .       if countryelection == 81
replace voteper_GREEN_ASP =.     if countryelection == 81
replace voteper_PIRATE_ASP = .     if countryelection == 81
replace voteper_MISC_POP_ASP = .  if countryelection == 81
replace voteper_SEC_NAT_ASP = .   if countryelection == 81
replace voteper_REL_ASP =.       if countryelection == 81
replace voteper_OTHERR_ASP = 3.6    if countryelection == 81
replace voteper_OTHERL_ASP = .    if countryelection == 81

*1987*
replace string_PSparties = "Social Democrat (29.3), Venstre (10.5), Centre Democrats (4.8), Christian Democrats (2.4), Conservative People's Party (20.8), Social Liberal (6.2), Justice Party (0.5, Other), " if countryelection == 82
replace string_CPparties = "Ind/Other (0.3, Ind)" if countryelection == 82
replace string_SCparties = "Socialist People's Party (14.6, RL)" if countryelection == 82
replace string_ASparties = "Communist (0.9, Com), Greens (1.3, Green), Common Course (2.2, Com), Left Socialists (1.4, Com), Progress Party (4.8, Libert)" if countryelection == 82

replace voteper_PSparties = 74.5 if countryelection == 82
replace voteper_CPparties =  0.3  if countryelection == 82
replace voteper_SCparties = 14.6  if countryelection == 82
replace voteper_ASparties = 10.6 if countryelection == 82

replace voteper_EL_ASP = 4.5      if countryelection == 82
replace voteper_RL_ASP =.        if countryelection == 82
replace voteper_ER_ASP =.        if countryelection == 82
replace voteper_RR_ASP = .       if countryelection == 82
replace voteper_GREEN_ASP = 1.3    if countryelection == 82
replace voteper_PIRATE_ASP = .     if countryelection == 82
replace voteper_MISC_POP_ASP = .  if countryelection == 82
replace voteper_SEC_NAT_ASP = .   if countryelection == 82
replace voteper_REL_ASP =.       if countryelection == 82
replace voteper_OTHERR_ASP = 4.8    if countryelection == 82
replace voteper_OTHERL_ASP = .    if countryelection == 82

*1988*
replace string_PSparties = "Social Democrat (29.8), Venstre (11.8), Centre Democrats (4.7), Christian Democrats (2), Conservative People's Party (19.3), Social Liberal (5.6)" if countryelection == 83
replace string_CPparties = "Ind/Other (0.1, Ind)" if countryelection == 83
replace string_SCparties = "Socialist People's Party (13, RL)" if countryelection == 83
replace string_ASparties = "Communist (0.8, Com), Greens (1.4, Green), Common Course (1.9, Com), Left Socialists (0.6, Com), Progress Party (9, Libert)" if countryelection == 83

replace voteper_PSparties = 73.2 if countryelection == 83
replace voteper_CPparties =  0.2  if countryelection == 83
replace voteper_SCparties = 13.0   if countryelection == 83
replace voteper_ASparties = 13.6 if countryelection == 83

replace voteper_EL_ASP = 3.2      if countryelection == 83
replace voteper_RL_ASP =.        if countryelection == 83
replace voteper_ER_ASP =.        if countryelection == 83
replace voteper_RR_ASP = .       if countryelection == 83
replace voteper_GREEN_ASP = 1.4     if countryelection == 83
replace voteper_PIRATE_ASP = .     if countryelection == 83
replace voteper_MISC_POP_ASP = .  if countryelection == 83
replace voteper_SEC_NAT_ASP = .   if countryelection == 83
replace voteper_REL_ASP =.       if countryelection == 83
replace voteper_OTHERR_ASP = 9    if countryelection == 83
replace voteper_OTHERL_ASP = .    if countryelection == 83

*1990*
replace string_PSparties = "Social Democrat (37.4), Venstre (15.8), Centre Democrats (5.1), Christian Democrats (2.3), Conservative People's Party (16), Social Liberal (3.5), Justice Party (0.5, Other), " if countryelection == 84
replace string_CPparties = "Ind/Other (0.3, Ind)" if countryelection == 84
replace string_SCparties = "Socialist People's Party (8.3, RL)" if countryelection == 84
replace string_ASparties = "Greens (0.9, Green), Common Course (1.8, Com), Left Alliance (1.7, EL), Progress Party (6.4, Libert)" if countryelection == 84

replace voteper_PSparties = 80.6 if countryelection == 84
replace voteper_CPparties =  0.3  if countryelection == 84
replace voteper_SCparties =  8.3   if countryelection == 84
replace voteper_ASparties = 10.8 if countryelection == 84

replace voteper_EL_ASP = 3.5      if countryelection == 84
replace voteper_RL_ASP =.        if countryelection == 84
replace voteper_ER_ASP =.        if countryelection == 84
replace voteper_RR_ASP = .       if countryelection == 84
replace voteper_GREEN_ASP = 0.9     if countryelection == 84
replace voteper_PIRATE_ASP = .     if countryelection == 84
replace voteper_MISC_POP_ASP = .  if countryelection == 84
replace voteper_SEC_NAT_ASP = .   if countryelection == 84
replace voteper_REL_ASP =.       if countryelection == 84
replace voteper_OTHERR_ASP = 6.4    if countryelection == 84
replace voteper_OTHERL_ASP = .    if countryelection == 84

*1994*
replace string_PSparties = "Social Democrat (34.6), Socialist People's Party (7.3), Venstre (23.3), Centre Democrats (2.8), Christian Democrats (1.9), Conservative People's Party (15), Social Liberal (4.6)" if countryelection == 85
replace string_CPparties = "Ind/Other (1 Ind)" if countryelection == 85
replace string_SCparties = "NA" if countryelection == 85
replace string_ASparties = "Left Alliance (3.1, EL), Progress Party (6.4, Libert)" if countryelection == 85

replace voteper_PSparties = 89.5 if countryelection == 85
replace voteper_CPparties = 1 if countryelection == 85
replace voteper_SCparties = 0   if countryelection == 85
replace voteper_ASparties = 9.5 if countryelection == 85

replace voteper_EL_ASP = 3.1     if countryelection == 85
replace voteper_RL_ASP =.        if countryelection == 85
replace voteper_ER_ASP =.        if countryelection == 85
replace voteper_RR_ASP = .       if countryelection == 85
replace voteper_GREEN_ASP =.     if countryelection == 85
replace voteper_PIRATE_ASP = .     if countryelection == 85
replace voteper_MISC_POP_ASP = .  if countryelection == 85
replace voteper_SEC_NAT_ASP = .   if countryelection == 85
replace voteper_REL_ASP =.       if countryelection == 85
replace voteper_OTHERR_ASP = 6.4    if countryelection == 85
replace voteper_OTHERL_ASP = .    if countryelection == 85

*1998*
replace string_PSparties = "Social Democrat (35.9), Socialist People's Party (7.6), Venstre (24), Centre Democrats (4.3), Christian Democrats (2.5), Conservative People's Party (8.9), Social Liberal (3.9)" if countryelection == 86
replace string_CPparties = "Ind/Other (0.1 Ind)" if countryelection == 86
replace string_SCparties = "NA" if countryelection == 86
replace string_ASparties = "Left Alliance (2.7, EL), Progress Party (2.4, OR), Democratic Renewal (Misc. Pop, 0.3), Danish People's Party (RR, 7.4)" if countryelection == 86

replace voteper_PSparties = 87.1 if countryelection == 86
replace voteper_CPparties =  0.1 if countryelection == 86
replace voteper_SCparties =  0  if countryelection == 86
replace voteper_ASparties = 12.8 if countryelection == 86

replace voteper_EL_ASP = 2.7      if countryelection == 86
replace voteper_RL_ASP =.        if countryelection == 86
replace voteper_ER_ASP =.        if countryelection == 86
replace voteper_RR_ASP = 7.4       if countryelection == 86
replace voteper_GREEN_ASP =.     if countryelection == 86
replace voteper_PIRATE_ASP = .     if countryelection == 86
replace voteper_MISC_POP_ASP = 0.3  if countryelection == 86
replace voteper_SEC_NAT_ASP = .   if countryelection == 86
replace voteper_REL_ASP =.       if countryelection == 86
replace voteper_OTHERR_ASP = 2.4   if countryelection == 86
replace voteper_OTHERL_ASP = .    if countryelection == 86

*2001*
replace string_PSparties = "Social Democrat (29.1), Socialist People's Party (6.4), Venstre (31.2), Centre Democrats (1.8), Christian Democrats (2.3), Conservative People's Party (9.1), Social Liberal (5.2)" if countryelection == 87
replace string_CPparties = "NA" if countryelection == 87
replace string_SCparties = "Left Alliance (2.4, EL)" if countryelection == 87
replace string_ASparties = "Progress Party (0.5, OR), Danish People's Party (RR, 12)" if countryelection == 87

replace voteper_PSparties =  85.1 if countryelection == 87
replace voteper_CPparties = 0 if countryelection == 87
replace voteper_SCparties =  2.4 if countryelection == 87
replace voteper_ASparties =  12.5  if countryelection == 87

replace voteper_EL_ASP = .     if countryelection == 87
replace voteper_RL_ASP =.        if countryelection == 87
replace voteper_ER_ASP =.        if countryelection == 87
replace voteper_RR_ASP = 12       if countryelection == 87
replace voteper_GREEN_ASP =.     if countryelection == 87
replace voteper_PIRATE_ASP = .     if countryelection == 87
replace voteper_MISC_POP_ASP = .  if countryelection == 87
replace voteper_SEC_NAT_ASP = .   if countryelection == 87
replace voteper_REL_ASP =.       if countryelection == 87
replace voteper_OTHERR_ASP = 0.5   if countryelection == 87
replace voteper_OTHERL_ASP = .    if countryelection == 87

*2005*
replace string_PSparties = "Social Democrat (25.8), Socialist People's Party (6), Venstre (29), Centre Democrats (1), Christian Democrats (1.7), Conservative People's Party (10.3), Social Liberal (9.2)" if countryelection == 88
replace string_CPparties = "Minority Party (0.3, Min)" if countryelection == 88
replace string_SCparties = "Left Alliance (3.4, EL), Danish People's Party (RR, 13.3)" if countryelection == 88
replace string_ASparties = "NA" if countryelection == 88

replace voteper_PSparties = 83  if countryelection == 88
replace voteper_CPparties =  0.3 if countryelection == 88
replace voteper_SCparties = 16.7 if countryelection == 88
replace voteper_ASparties =  0 if countryelection == 88

replace voteper_EL_ASP = .      if countryelection == 88
replace voteper_RL_ASP =.        if countryelection == 88
replace voteper_ER_ASP =.        if countryelection == 88
replace voteper_RR_ASP = .       if countryelection == 88
replace voteper_GREEN_ASP =.     if countryelection == 88
replace voteper_PIRATE_ASP = .     if countryelection == 88
replace voteper_MISC_POP_ASP = .  if countryelection == 88
replace voteper_SEC_NAT_ASP = .   if countryelection == 88
replace voteper_REL_ASP =.       if countryelection == 88
replace voteper_OTHERR_ASP = .   if countryelection == 88
replace voteper_OTHERL_ASP = .    if countryelection == 88

*2007*
replace string_PSparties = "Social Democrat (25.5), Socialist People's Party (13), Venstre (26.2), Christian Democrats (0.9), Conservative People's Party (10.4), Social Liberal (5.1)" if countryelection == 89
replace string_CPparties = "New Alliance (2.9, Lib)" if countryelection == 89
replace string_SCparties = "Left Alliance (2.2, EL), Danish People's Party (RR, 13.9)" if countryelection == 89
replace string_ASparties = "NA" if countryelection == 89

replace voteper_PSparties =  81 if countryelection == 89
replace voteper_CPparties =  2.9 if countryelection == 89
replace voteper_SCparties = 16.1  if countryelection == 89
replace voteper_ASparties = 0 if countryelection == 89

replace voteper_EL_ASP = .      if countryelection == 89
replace voteper_RL_ASP =.        if countryelection == 89
replace voteper_ER_ASP =.        if countryelection == 89
replace voteper_RR_ASP = .       if countryelection == 89
replace voteper_GREEN_ASP =.     if countryelection == 89
replace voteper_PIRATE_ASP = .     if countryelection == 89
replace voteper_MISC_POP_ASP = .  if countryelection == 89
replace voteper_SEC_NAT_ASP = .   if countryelection == 89
replace voteper_REL_ASP =.       if countryelection == 89
replace voteper_OTHERR_ASP = .   if countryelection == 89
replace voteper_OTHERL_ASP = .    if countryelection == 89

*2011*
replace string_PSparties = "Social Democrat (24.8), Socialist People's Party (9.2), Venstre (26.7), Christian Democrats (0.8), Conservative People's Party (4.9), Social Liberal (9.5)" if countryelection == 90
replace string_CPparties = "New Alliance (5, Lib)" if countryelection == 90
replace string_SCparties = "Left Alliance (6.7, RL), Danish People's Party (RR, 12.3)" if countryelection == 90
replace string_ASparties = "NA" if countryelection == 90

replace voteper_PSparties = 75.9 if countryelection == 90
replace voteper_CPparties = 5  if countryelection == 90
replace voteper_SCparties = 19  if countryelection == 90
replace voteper_ASparties = 0 if countryelection == 90

replace voteper_EL_ASP = .      if countryelection == 90
replace voteper_RL_ASP =.        if countryelection == 90
replace voteper_ER_ASP =.        if countryelection == 90
replace voteper_RR_ASP = .       if countryelection == 90
replace voteper_GREEN_ASP =.     if countryelection == 90
replace voteper_PIRATE_ASP = .     if countryelection == 90
replace voteper_MISC_POP_ASP = .  if countryelection == 90
replace voteper_SEC_NAT_ASP = .   if countryelection == 90
replace voteper_REL_ASP =.       if countryelection == 90
replace voteper_OTHERR_ASP = .   if countryelection == 90
replace voteper_OTHERL_ASP = .    if countryelection == 90

*2015*
replace string_PSparties = "Social Democrat (26.3), Socialist People's Party (4.2), Venstre (19.5), Christian Democrats (0.8), Conservative People's Party (3.4), Social Liberal (4.6)" if countryelection == 91
replace string_CPparties = "New Alliance (7.5, Lib), Other (0.1, Other)" if countryelection == 91
replace string_SCparties = "Left Alliance (7.8, RL), Danish People's Party (RR, 21.1)" if countryelection == 91
replace string_ASparties = "Alternative (4.8, Green)" if countryelection == 91

replace voteper_PSparties = 58.8 if countryelection == 91
replace voteper_CPparties = 7.6  if countryelection == 91
replace voteper_SCparties = 28.9 if countryelection == 91
replace voteper_ASparties = 4.8  if countryelection == 91

replace voteper_EL_ASP = .      if countryelection == 91
replace voteper_RL_ASP =.        if countryelection == 91
replace voteper_ER_ASP =.        if countryelection == 91
replace voteper_RR_ASP = .       if countryelection == 91
replace voteper_GREEN_ASP = 4.8     if countryelection == 91
replace voteper_PIRATE_ASP = .     if countryelection == 91
replace voteper_MISC_POP_ASP = .  if countryelection == 91
replace voteper_SEC_NAT_ASP = .   if countryelection == 91
replace voteper_REL_ASP =.       if countryelection == 91
replace voteper_OTHERR_ASP = .   if countryelection == 91
replace voteper_OTHERL_ASP = .    if countryelection == 91


************************************************************** FINLAND *************************************************************************

***** Source:  Nohlen and Stover (2010) [1951-2007]
*              Vaalien tulospalvelut Valresultattjänster - Election Results Service Website [2011-2015]



*1951*
replace string_PSparties = "SDP (26.5), KESK (23.3), KOK (14.6), SFP (7.3), National Progressive/PP (5.7)" if countryelection == 92
replace string_CPparties = "Other/Indep (1.1, Oth)" if countryelection == 92
replace string_SCparties = "NA" if countryelection == 92
replace string_ASparties = "SKDL (21.6, Com/EL)" if countryelection == 92

replace voteper_PSparties = 77.4 if countryelection == 92
replace voteper_CPparties = 1.1  if countryelection == 92
replace voteper_SCparties = 0  if countryelection == 92
replace voteper_ASparties = 21.6 if countryelection == 92

replace voteper_EL_ASP = 21.6      if countryelection == 92
replace voteper_RL_ASP =.        if countryelection == 92
replace voteper_ER_ASP =.        if countryelection == 92
replace voteper_RR_ASP = .       if countryelection == 92
replace voteper_GREEN_ASP =.     if countryelection == 92
replace voteper_PIRATE_ASP = .     if countryelection == 92
replace voteper_MISC_POP_ASP = .  if countryelection == 92
replace voteper_SEC_NAT_ASP = .   if countryelection == 92
replace voteper_REL_ASP =.       if countryelection == 92
replace voteper_OTHERR_ASP = .   if countryelection == 92
replace voteper_OTHERL_ASP = .    if countryelection == 92

*1954*
replace string_PSparties = "SDP (26.2), KESK (24.1), KOK (12.8), SFP (6.8), National Progressive/PP (7.9)" if countryelection == 93
replace string_CPparties = "Other/Indep (0.6, Oth)" if countryelection == 93
replace string_SCparties = "NA" if countryelection == 93
replace string_ASparties = "SKDL (21.6, Com)" if countryelection == 93

replace voteper_PSparties = 77.8 if countryelection == 93
replace voteper_CPparties = 0.6  if countryelection == 93
replace voteper_SCparties = 0  if countryelection == 93
replace voteper_ASparties = 21.6 if countryelection == 93

replace voteper_EL_ASP = 21.6      if countryelection == 93
replace voteper_RL_ASP =.        if countryelection == 93
replace voteper_ER_ASP =.        if countryelection == 93
replace voteper_RR_ASP = .       if countryelection == 93
replace voteper_GREEN_ASP =.     if countryelection == 93
replace voteper_PIRATE_ASP = .     if countryelection == 93
replace voteper_MISC_POP_ASP = .  if countryelection == 93
replace voteper_SEC_NAT_ASP = .   if countryelection == 93
replace voteper_REL_ASP =.       if countryelection == 93
replace voteper_OTHERR_ASP = .   if countryelection == 93
replace voteper_OTHERL_ASP = .    if countryelection == 93

*1958*
replace string_PSparties = "SDP (23.1), KESK (23.1), KOK (15.3), SFP (6.5), National Progressive/PP (5.9), Social Democratic Union (1.7)" if countryelection == 94
replace string_CPparties = "Other/Indep (1.2, Oth)" if countryelection == 94
replace string_SCparties = "NA" if countryelection == 94
replace string_ASparties = "SKDL (23.2, Com)" if countryelection == 94

replace voteper_PSparties =  75.6 if countryelection == 94
replace voteper_CPparties =  1.2  if countryelection == 94
replace voteper_SCparties =  0 if countryelection == 94
replace voteper_ASparties = 23.2 if countryelection == 94

replace voteper_EL_ASP = 23.2      if countryelection == 94
replace voteper_RL_ASP =.        if countryelection == 94
replace voteper_ER_ASP =.        if countryelection == 94
replace voteper_RR_ASP = .       if countryelection == 94
replace voteper_GREEN_ASP =.     if countryelection == 94
replace voteper_PIRATE_ASP = .     if countryelection == 94
replace voteper_MISC_POP_ASP = .  if countryelection == 94
replace voteper_SEC_NAT_ASP = .   if countryelection == 94
replace voteper_REL_ASP =.       if countryelection == 94
replace voteper_OTHERR_ASP = .   if countryelection == 94
replace voteper_OTHERL_ASP = .    if countryelection == 94

*1962*
replace string_PSparties = "SDP (19.5), KESK (23), KOK (15.1), SFP (6.1), National Progressive/PP (6.3), Social Democratic Union (4.4)" if countryelection == 95
replace string_CPparties = "Other/Indep (1.5, Oth)" if countryelection == 95
replace string_SCparties = "NA" if countryelection == 95
replace string_ASparties = "SKDL (22, Com), Rural Party (2.2, Misc. Pop)" if countryelection == 95

replace voteper_PSparties =  74.4 if countryelection == 95
replace voteper_CPparties =  1.5  if countryelection == 95
replace voteper_SCparties =  0 if countryelection == 95
replace voteper_ASparties = 24.2 if countryelection == 95

replace voteper_EL_ASP = 22      if countryelection == 95
replace voteper_RL_ASP =.        if countryelection == 95
replace voteper_ER_ASP =.        if countryelection == 95
replace voteper_RR_ASP = .       if countryelection == 95
replace voteper_GREEN_ASP =.     if countryelection == 95
replace voteper_PIRATE_ASP = .     if countryelection == 95
replace voteper_MISC_POP_ASP = 2.2  if countryelection == 95
replace voteper_SEC_NAT_ASP = .   if countryelection == 95
replace voteper_REL_ASP =.       if countryelection == 95
replace voteper_OTHERR_ASP = .   if countryelection == 95
replace voteper_OTHERL_ASP = .    if countryelection == 95

*1966*
replace string_PSparties = "SDP (27.2), KESK (21.2), KOK (13.8), SFP (5.7), Liberal Party (6.5), Social Democratic Union (2.6)" if countryelection == 96
replace string_CPparties = "Other/Indep (0.3, Oth), Christian League (0.4, Rel)" if countryelection == 96
replace string_SCparties = "NA" if countryelection == 96
replace string_ASparties = "SKDL (21.2, Com), Rural Party (1, Misc. Pop)" if countryelection == 96

replace voteper_PSparties = 77 if countryelection == 96
replace voteper_CPparties = 0.7  if countryelection == 96
replace voteper_SCparties = 0  if countryelection == 96
replace voteper_ASparties = 22.2 if countryelection == 96

replace voteper_EL_ASP = 21.2      if countryelection == 96
replace voteper_RL_ASP =.        if countryelection == 96
replace voteper_ER_ASP =.        if countryelection == 96
replace voteper_RR_ASP = .       if countryelection == 96
replace voteper_GREEN_ASP =.     if countryelection == 96
replace voteper_PIRATE_ASP = .     if countryelection == 96
replace voteper_MISC_POP_ASP = 1  if countryelection == 96
replace voteper_SEC_NAT_ASP = .   if countryelection == 96
replace voteper_REL_ASP =.       if countryelection == 96
replace voteper_OTHERR_ASP = .   if countryelection == 96
replace voteper_OTHERL_ASP = .    if countryelection == 96

*1970*
replace string_PSparties = "SDP (23.4), KESK (17.1), KOK (18), SFP (5.3), Liberal Party (5.9), Social Democratic Union (1.4)" if countryelection == 97
replace string_CPparties = "Other/Indep (0.6, Oth), Christian League (1.1, Rel)" if countryelection == 97
replace string_SCparties = "SKDL (16.6, Com)" if countryelection == 97
replace string_ASparties = "Rural Party (10.5, Misc. Pop)" if countryelection == 97

replace voteper_PSparties = 71.1 if countryelection == 97
replace voteper_CPparties =  1.7 if countryelection == 97
replace voteper_SCparties = 16.6  if countryelection == 97
replace voteper_ASparties = 10.5 if countryelection == 97

replace voteper_EL_ASP = .      if countryelection == 97
replace voteper_RL_ASP =.        if countryelection == 97
replace voteper_ER_ASP =.        if countryelection == 97
replace voteper_RR_ASP = .       if countryelection == 97
replace voteper_GREEN_ASP =.     if countryelection == 97
replace voteper_PIRATE_ASP = .     if countryelection == 97
replace voteper_MISC_POP_ASP = 10.5  if countryelection == 97
replace voteper_SEC_NAT_ASP = .   if countryelection == 97
replace voteper_REL_ASP =.       if countryelection == 97
replace voteper_OTHERR_ASP = .   if countryelection == 97
replace voteper_OTHERL_ASP = .    if countryelection == 97

*1972*
replace string_PSparties = "SDP (25.8), KESK (16.4), KOK (17.6), SFP (5.1), Liberal Party (5.2), Social Democratic Union (1)" if countryelection == 98
replace string_CPparties = "Other/Indep (0.3, Oth), Christian League (2.5, Rel)" if countryelection == 98
replace string_SCparties = "SKDL (17, Com)" if countryelection == 98
replace string_ASparties = "Rural Party (9.2, Misc. Pop)" if countryelection == 98

replace voteper_PSparties = 71.1 if countryelection == 98
replace voteper_CPparties = 2.8 if countryelection == 98
replace voteper_SCparties = 17  if countryelection == 98
replace voteper_ASparties = 9.2 if countryelection == 98

replace voteper_EL_ASP = .      if countryelection == 98
replace voteper_RL_ASP =.        if countryelection == 98
replace voteper_ER_ASP =.        if countryelection == 98
replace voteper_RR_ASP = .       if countryelection == 98
replace voteper_GREEN_ASP =.     if countryelection == 98
replace voteper_PIRATE_ASP = .     if countryelection == 98
replace voteper_MISC_POP_ASP = 9.2  if countryelection == 98
replace voteper_SEC_NAT_ASP = .   if countryelection == 98
replace voteper_REL_ASP =.       if countryelection == 98
replace voteper_OTHERR_ASP = .   if countryelection == 98
replace voteper_OTHERL_ASP = .    if countryelection == 98

*1975*
replace string_PSparties = "SDP (24.9), KESK (17.6), KOK (18.4), SFP (4.7), Liberal Party (4.3), Unification (1.6)" if countryelection == 99
replace string_CPparties = "Other/Indep (1.1, Oth), Christian League (3.3, Rel), Constitutional People (1.6, Lib)" if countryelection == 99
replace string_SCparties = "SKDL (18.9, Com)" if countryelection == 99
replace string_ASparties = "Rural Party (3.6, Misc. Pop)" if countryelection == 99

replace voteper_PSparties = 71.5 if countryelection == 99
replace voteper_CPparties =  6 if countryelection == 99
replace voteper_SCparties = 18.9  if countryelection == 99
replace voteper_ASparties =  3.6 if countryelection == 99

replace voteper_EL_ASP = .      if countryelection == 99
replace voteper_RL_ASP =.        if countryelection == 99
replace voteper_ER_ASP =.        if countryelection == 99
replace voteper_RR_ASP = .       if countryelection == 99
replace voteper_GREEN_ASP =.     if countryelection == 99
replace voteper_PIRATE_ASP = .     if countryelection == 99
replace voteper_MISC_POP_ASP = 3.6  if countryelection == 99
replace voteper_SEC_NAT_ASP = .   if countryelection == 99
replace voteper_REL_ASP =.       if countryelection == 99
replace voteper_OTHERR_ASP = .   if countryelection == 99
replace voteper_OTHERL_ASP = .    if countryelection == 99

*1979*
replace string_PSparties = "SDP (23.9), KESK (17.3), KOK (21.7), SFP (4.2), Liberal Party (3.7), Unification (0.3)" if countryelection == 100
replace string_CPparties = "Other/Indep (0.5, Oth), Christian League (4.8, Rel), Constitutional People (1.2, Lib)" if countryelection == 100
replace string_SCparties = "SKDL (17.9, Com)" if countryelection == 100
replace string_ASparties = "Rural Party (4.6, Misc. Pop)" if countryelection == 100

replace voteper_PSparties = 71.1 if countryelection == 100
replace voteper_CPparties =  6.5 if countryelection == 100
replace voteper_SCparties = 17.9 if countryelection == 100
replace voteper_ASparties =  4.6 if countryelection == 100

replace voteper_EL_ASP = .      if countryelection == 100
replace voteper_RL_ASP =.        if countryelection == 100
replace voteper_ER_ASP =.        if countryelection == 100
replace voteper_RR_ASP = .       if countryelection == 100
replace voteper_GREEN_ASP =.     if countryelection == 100
replace voteper_PIRATE_ASP = .     if countryelection == 100
replace voteper_MISC_POP_ASP = 4.6  if countryelection == 100
replace voteper_SEC_NAT_ASP = .   if countryelection == 100
replace voteper_REL_ASP =.       if countryelection == 100
replace voteper_OTHERR_ASP = .   if countryelection == 100
replace voteper_OTHERL_ASP = .    if countryelection == 100

*1983*
replace string_PSparties = "SDP (26.7), KESK (17.6), KOK (22.1), SFP (4.6)" if countryelection == 101
replace string_CPparties = "Other/Indep (1, Oth), Christian League (3, Rel), Constitutional People (0.4, Lib)" if countryelection == 101
replace string_SCparties = "SKDL (13.5, Com)" if countryelection == 101
replace string_ASparties = "Rural Party (9.7, Misc. Pop), Greens (1.4, Green)" if countryelection == 101

replace voteper_PSparties = 71 if countryelection == 101
replace voteper_CPparties =  4.4 if countryelection == 101
replace voteper_SCparties = 13.5 if countryelection == 101
replace voteper_ASparties =  11.1 if countryelection == 101

replace voteper_EL_ASP = .      if countryelection == 101
replace voteper_RL_ASP =.        if countryelection == 101
replace voteper_ER_ASP =.        if countryelection == 101
replace voteper_RR_ASP = .       if countryelection == 101
replace voteper_GREEN_ASP = 1.4     if countryelection == 101
replace voteper_PIRATE_ASP = .     if countryelection == 101
replace voteper_MISC_POP_ASP = 9.7  if countryelection == 101
replace voteper_SEC_NAT_ASP = .   if countryelection == 101
replace voteper_REL_ASP =.       if countryelection == 101
replace voteper_OTHERR_ASP = .   if countryelection == 101
replace voteper_OTHERL_ASP = .    if countryelection == 101

*1987*
replace string_PSparties = "SDP (24.1), KESK (17.6), KOK (23.1), SFP (5.3), Liberals (1)" if countryelection == 102
replace string_CPparties = "Other/Indep (1, Oth), Christian League (2.6, Rel), Constitutional People (0.1, Lib), Pensioners (1.2, Pen)" if countryelection == 102
replace string_SCparties = "SKDL (9.4, Com), Rural Party (6.3, Misc. Pop)" if countryelection == 102
replace string_ASparties = "Greens (4, Green), Democratic Alternative (4.2, Com)" if countryelection == 102

replace voteper_PSparties = 71.1 if countryelection == 102
replace voteper_CPparties =  4.9 if countryelection == 102
replace voteper_SCparties =  15.7  if countryelection == 102
replace voteper_ASparties =  8.2 if countryelection == 102

replace voteper_EL_ASP = 4.2      if countryelection == 102
replace voteper_RL_ASP =.        if countryelection == 102
replace voteper_ER_ASP =.        if countryelection == 102
replace voteper_RR_ASP = .       if countryelection == 102
replace voteper_GREEN_ASP = 4     if countryelection == 102
replace voteper_PIRATE_ASP = .     if countryelection == 102
replace voteper_MISC_POP_ASP = .  if countryelection == 102
replace voteper_SEC_NAT_ASP = .   if countryelection == 102
replace voteper_REL_ASP =.       if countryelection == 102
replace voteper_OTHERR_ASP = .   if countryelection == 102
replace voteper_OTHERL_ASP = .    if countryelection == 102

*1991*
replace string_PSparties = "SDP (22.1), KESK (24.8), KOK (19.3), SFP (5.5), Liberals (0.8)" if countryelection == 103
replace string_CPparties = "Women's Movement (0.5, Fem), Other/Indep (2.2, Oth), Christian League (3.1, Rel)" if countryelection == 103
replace string_SCparties = "Rural Party (4.8, Misc. Pop)" if countryelection == 103
replace string_ASparties = "Greens (6.8, Green), Left Alliance (10.1, RL)" if countryelection == 103

replace voteper_PSparties = 72.5 if countryelection == 103
replace voteper_CPparties =  5.8 if countryelection == 103
replace voteper_SCparties =  4.8 if countryelection == 103
replace voteper_ASparties = 16.9 if countryelection == 103

replace voteper_EL_ASP = .      if countryelection == 103
replace voteper_RL_ASP = 10.1        if countryelection == 103
replace voteper_ER_ASP =.        if countryelection == 103
replace voteper_RR_ASP = .       if countryelection == 103
replace voteper_GREEN_ASP = 6.8     if countryelection == 103
replace voteper_PIRATE_ASP = .     if countryelection == 103
replace voteper_MISC_POP_ASP = .  if countryelection == 103
replace voteper_SEC_NAT_ASP = .   if countryelection == 103
replace voteper_REL_ASP =.       if countryelection == 103
replace voteper_OTHERR_ASP = .   if countryelection == 103
replace voteper_OTHERL_ASP = .    if countryelection == 103

*1995*
replace string_PSparties = "SDP (28.3), KESK (19.8), KOK (17.9), SFP (5.1), Liberals (0.6), Christian League (3)" if countryelection == 104
replace string_CPparties = "Other/Indep (2.5, Oth), Young Finns (2.8, Lib)" if countryelection == 104
replace string_SCparties = "Rural Party (1.3, Misc. Pop)" if countryelection == 104
replace string_ASparties = "Greens (6.5, Green), Left Alliance (11.2, RL), Free Finland Alliance (1, MISC_POP)" if countryelection == 104

replace voteper_PSparties = 74.7 if countryelection == 104
replace voteper_CPparties = 5.3 if countryelection == 104
replace voteper_SCparties = 1.3  if countryelection == 104
replace voteper_ASparties = 18.7 if countryelection == 104

replace voteper_EL_ASP = .      if countryelection == 104
replace voteper_RL_ASP = 11.2       if countryelection == 104
replace voteper_ER_ASP =.        if countryelection == 104
replace voteper_RR_ASP = .       if countryelection == 104
replace voteper_GREEN_ASP = 6.5    if countryelection == 104
replace voteper_PIRATE_ASP = .     if countryelection == 104
replace voteper_MISC_POP_ASP = 1  if countryelection == 104
replace voteper_SEC_NAT_ASP = .   if countryelection == 104
replace voteper_REL_ASP =.       if countryelection == 104
replace voteper_OTHERR_ASP = .   if countryelection == 104
replace voteper_OTHERL_ASP = .    if countryelection == 104

*1999*
replace string_PSparties = "SDP (22.9), KESK (22.4), KOK (21), SFP (5.1), Christian League (4.2), Green League (7.3)" if countryelection == 105
replace string_CPparties = "Other/Indep (2, Oth), Young Finns (1, Lib)" if countryelection == 105
replace string_SCparties = "Left Alliance (10.9, RL)" if countryelection == 105
replace string_ASparties = "Communist Party (0.8, Com), Free Finland Alliance (0.4, MISC_POP), Reform (1.1, MISC_POP), True Finns (1, RR)" if countryelection == 105

replace voteper_PSparties = 82.9  if countryelection == 105
replace voteper_CPparties = 3     if countryelection == 105
replace voteper_SCparties = 10.9  if countryelection == 105
replace voteper_ASparties = 3.3   if countryelection == 105

replace voteper_EL_ASP = 0.8     if countryelection == 105
replace voteper_RL_ASP = .       if countryelection == 105
replace voteper_ER_ASP =.        if countryelection == 105
replace voteper_RR_ASP = 1       if countryelection == 105
replace voteper_GREEN_ASP = .    if countryelection == 105
replace voteper_PIRATE_ASP = .     if countryelection == 105
replace voteper_MISC_POP_ASP = 1.5  if countryelection == 105
replace voteper_SEC_NAT_ASP = .   if countryelection == 105
replace voteper_REL_ASP =.       if countryelection == 105
replace voteper_OTHERR_ASP = .   if countryelection == 105
replace voteper_OTHERL_ASP = .    if countryelection == 105

*2003*
replace string_PSparties = "SDP (24.5), KESK (24.7), KOK (18.6), SFP (4.6), Christian League (5.3), Green League (8)" if countryelection == 106
replace string_CPparties = "Other/Indep (1.3, Oth)" if countryelection == 106
replace string_SCparties = "Left Alliance (9.9, RL)" if countryelection == 106
replace string_ASparties = "Communist Party (0.8, Com), Forces for Change (0.4, RR), Independence (0.4, MISC_POP), True Finns (1.6, RR)" if countryelection == 106

replace voteper_PSparties = 85.7 if countryelection == 106
replace voteper_CPparties =  1.3 if countryelection == 106
replace voteper_SCparties =  9.9 if countryelection == 106
replace voteper_ASparties =  3.2 if countryelection == 106

replace voteper_EL_ASP = 0.8     if countryelection == 106
replace voteper_RL_ASP = .       if countryelection == 106
replace voteper_ER_ASP =.        if countryelection == 106
replace voteper_RR_ASP = 2.0       if countryelection == 106
replace voteper_GREEN_ASP = .    if countryelection == 106
replace voteper_PIRATE_ASP = .     if countryelection == 106
replace voteper_MISC_POP_ASP = 0.4  if countryelection == 106
replace voteper_SEC_NAT_ASP = .   if countryelection == 106
replace voteper_REL_ASP =.       if countryelection == 106
replace voteper_OTHERR_ASP = .   if countryelection == 106
replace voteper_OTHERL_ASP = .    if countryelection == 106

*2007*
replace string_PSparties = "SDP (21.4), KESK (23.1), KOK (22.3), SFP (4.6), Christian League (4.9), Green League (8.5)" if countryelection == 107
replace string_CPparties = "Other/Indep (1.4, Oth)" if countryelection == 107
replace string_SCparties = "Left Alliance (8.8, RL)" if countryelection == 107
replace string_ASparties = "Communist Party (0.7, Com), Independence (0.2, MISC_POP), True Finns (4.1, RR)" if countryelection == 107

replace voteper_PSparties = 84.8 if countryelection == 107
replace voteper_CPparties =  1.4 if countryelection == 107
replace voteper_SCparties =  8.8  if countryelection == 107
replace voteper_ASparties =  5   if countryelection == 107

replace voteper_EL_ASP = 0.7     if countryelection == 107
replace voteper_RL_ASP = .       if countryelection == 107
replace voteper_ER_ASP =.        if countryelection == 107
replace voteper_RR_ASP = 4.1       if countryelection == 107
replace voteper_GREEN_ASP = .    if countryelection == 107
replace voteper_PIRATE_ASP = .     if countryelection == 107
replace voteper_MISC_POP_ASP = 0.2  if countryelection == 107
replace voteper_SEC_NAT_ASP = .   if countryelection == 107
replace voteper_REL_ASP =.       if countryelection == 107
replace voteper_OTHERR_ASP = .   if countryelection == 107
replace voteper_OTHERL_ASP = .    if countryelection == 107

*2011*
replace string_PSparties = "SDP (19.1), KESK (15.8), KOK (20.4), SFP (4.3), Christian League (4), Green League (7.3)" if countryelection == 108
replace string_CPparties = "Other/Indep (0.8, Oth)" if countryelection == 108
replace string_SCparties = "Left Alliance (8.1, RL)" if countryelection == 108
replace string_ASparties = "Communist Party (0.3, Com), Independence (0.1, MISC_POP), Change 2011 (0.3, RR), True Finns (19.1, RR), Pirate Party (0.5, Pirat)" if countryelection == 108

replace voteper_PSparties = 70.9 if countryelection == 108
replace voteper_CPparties =  0.7 if countryelection == 108
replace voteper_SCparties =  8.1  if countryelection == 108
replace voteper_ASparties = 20.3  if countryelection == 108

replace voteper_EL_ASP = 0.3     if countryelection == 108
replace voteper_RL_ASP = .       if countryelection == 108
replace voteper_ER_ASP =.        if countryelection == 108
replace voteper_RR_ASP = 19.4       if countryelection == 108
replace voteper_GREEN_ASP = .    if countryelection == 108
replace voteper_PIRATE_ASP = 0.5     if countryelection == 108
replace voteper_MISC_POP_ASP = 0.1  if countryelection == 108
replace voteper_SEC_NAT_ASP = .   if countryelection == 108
replace voteper_REL_ASP =.       if countryelection == 108
replace voteper_OTHERR_ASP = .   if countryelection == 108
replace voteper_OTHERL_ASP = .    if countryelection == 108

*2015*
replace string_PSparties = "SDP (16.5), KESK (21.1), KOK (18.2), SFP (4.9), Christian League (3.5), Green League (8.5)" if countryelection == 109
replace string_CPparties = "Other/Indep (0.6, Oth)" if countryelection == 109
replace string_SCparties = "Left Alliance (7.1)" if countryelection == 109
replace string_ASparties = "Communist Party (0.3, Com), Independence (0.5, MISC_POP), Change 2011 (0.3, RR), True Finns (17.7, RR), Pirate Party (0.8, Pirat)" if countryelection == 109

replace voteper_PSparties = 72.8 if countryelection == 109
replace voteper_CPparties =  0.6 if countryelection == 109
replace voteper_SCparties =  7.1 if countryelection == 109
replace voteper_ASparties = 19.6 if countryelection == 109

replace voteper_EL_ASP = 0.3     if countryelection == 109
replace voteper_RL_ASP = .       if countryelection == 109
replace voteper_ER_ASP =.        if countryelection == 109
replace voteper_RR_ASP = 18       if countryelection == 109
replace voteper_GREEN_ASP = .    if countryelection == 109
replace voteper_PIRATE_ASP = 0.8     if countryelection == 109
replace voteper_MISC_POP_ASP = 0.5  if countryelection == 109
replace voteper_SEC_NAT_ASP = .   if countryelection == 109
replace voteper_REL_ASP =.       if countryelection == 109
replace voteper_OTHERR_ASP = .   if countryelection == 109
replace voteper_OTHERL_ASP = .    if countryelection == 109


******************************************************************** FRANCE ************************************************************************

***** Source:  Nohlen and Stover (2010) [1951-2007]
*              Interieur.gouv.fr - Ministry of the Interior Website [2012]


*1951*
replace string_PSparties = "Socialists (14.3), Republican People's Movement (12.4), Rally of the Republican Lefts (9.9)" if countryelection == 110
replace string_CPparties = "Conservatives/Moderates (13.9, RW), Other (0.7, Other)" if countryelection == 110
replace string_SCparties = "NA" if countryelection == 110
replace string_ASparties = "Gaullists (21.6, OR), Communists (26.4, Com)" if countryelection == 110

replace voteper_PSparties = 37.4 if countryelection == 110
replace voteper_CPparties = 14.6 if countryelection == 110
replace voteper_SCparties =  0   if countryelection == 110
replace voteper_ASparties = 48   if countryelection == 110

replace voteper_EL_ASP = 26.4     if countryelection == 110
replace voteper_RL_ASP = .       if countryelection == 110
replace voteper_ER_ASP =.        if countryelection == 110
replace voteper_RR_ASP = .       if countryelection == 110
replace voteper_GREEN_ASP = .    if countryelection == 110
replace voteper_PIRATE_ASP = .     if countryelection == 110
replace voteper_MISC_POP_ASP = .  if countryelection == 110
replace voteper_SEC_NAT_ASP = .   if countryelection == 110
replace voteper_REL_ASP =.       if countryelection == 110
replace voteper_OTHERR_ASP = 21.6   if countryelection == 110
replace voteper_OTHERL_ASP = .    if countryelection == 110

*1956*
replace string_PSparties = "Socialists (15.1), Republican People's Movement (15.2), Rally of the Republican Lefts (12.1), Conservatives/Moderates (15.2, RW)" if countryelection == 111
replace string_CPparties = "Other (0.5, Other)" if countryelection == 111
replace string_SCparties = "NA" if countryelection == 111
replace string_ASparties = "Gaullists (3.9, OR), Communists (25.7, EL), Poujadists (11.6, RR), 'Other Extreme Right' (1.2, ER)" if countryelection == 111

replace voteper_PSparties = 57.6 if countryelection == 111
replace voteper_CPparties =  0.5 if countryelection == 111
replace voteper_SCparties =  0   if countryelection == 111
replace voteper_ASparties = 42.4 if countryelection == 111

replace voteper_EL_ASP = 25.7     if countryelection == 111
replace voteper_RL_ASP = .       if countryelection == 111
replace voteper_ER_ASP = 1.2        if countryelection == 111
replace voteper_RR_ASP = 11.6       if countryelection == 111
replace voteper_GREEN_ASP = .    if countryelection == 111
replace voteper_PIRATE_ASP = .     if countryelection == 111
replace voteper_MISC_POP_ASP = .  if countryelection == 111
replace voteper_SEC_NAT_ASP = .   if countryelection == 111
replace voteper_REL_ASP =.       if countryelection == 111
replace voteper_OTHERR_ASP = 3.9   if countryelection == 111
replace voteper_OTHERL_ASP = .    if countryelection == 111

*1958*
replace string_PSparties = "Socialists (15.5), Gaullists (18.7), National Centre of Independents (14.2), Republican People's Movement (11.1), Moderate Right (5.8), Radical Socialists (5.7, Centrist Radicals (3.5), Centre of Repbulican Reform (2)" if countryelection == 112
replace string_CPparties = "Other (1.1)" if countryelection == 112
replace string_SCparties = "NA" if countryelection == 112
replace string_ASparties = "Communists (18.9, Com), Poujadists (1.5, RR), 'Extreme Right' (1.1, ER), UFD (0.9, OL)" if countryelection == 112

replace voteper_PSparties = 76.5 if countryelection == 112
replace voteper_CPparties = 1.1  if countryelection == 112
replace voteper_SCparties = 0    if countryelection == 112
replace voteper_ASparties = 22.4 if countryelection == 112

replace voteper_EL_ASP = 18.9    if countryelection == 112
replace voteper_RL_ASP = .       if countryelection == 112
replace voteper_ER_ASP = 1.1        if countryelection == 112
replace voteper_RR_ASP = 1.5       if countryelection == 112
replace voteper_GREEN_ASP = .    if countryelection == 112
replace voteper_PIRATE_ASP = .     if countryelection == 112
replace voteper_MISC_POP_ASP = .  if countryelection == 112
replace voteper_SEC_NAT_ASP = .   if countryelection == 112
replace voteper_REL_ASP =.       if countryelection == 112
replace voteper_OTHERR_ASP = .   if countryelection == 112
replace voteper_OTHERL_ASP = 0.9    if countryelection == 112

*1962*
replace string_PSparties = "Socialists (12.4), Gaullists (33.4), Republican People's Movement (7.9), National Centre of Independents (7.3), Radical Socialists (4.9), Right-Wing Radicals (4.2), Centrist Radicals (2.5), Republican Independents (2.3)" if countryelection == 113
replace string_CPparties = "Independents (0.4)" if countryelection == 113
replace string_SCparties = "NA" if countryelection == 113
replace string_ASparties = "Communists (21.9, Com), United Socialists (2.0, RL), 'Extreme Right' (0.5, ER), Poujadists (0.3, RR)" if countryelection == 113

replace voteper_PSparties = 74.9 if countryelection == 113
replace voteper_CPparties =  0.4  if countryelection == 113
replace voteper_SCparties =  0  if countryelection == 113
replace voteper_ASparties = 24.7 if countryelection == 113

replace voteper_EL_ASP = 21.9     if countryelection == 113
replace voteper_RL_ASP = 2.0       if countryelection == 113
replace voteper_ER_ASP = 0.5        if countryelection == 113
replace voteper_RR_ASP = 0.3       if countryelection == 113
replace voteper_GREEN_ASP = .    if countryelection == 113
replace voteper_PIRATE_ASP = .     if countryelection == 113
replace voteper_MISC_POP_ASP = .  if countryelection == 113
replace voteper_SEC_NAT_ASP = .   if countryelection == 113
replace voteper_REL_ASP =.       if countryelection == 113
replace voteper_OTHERR_ASP = .   if countryelection == 113
replace voteper_OTHERL_ASP = .    if countryelection == 113

*1967*
replace string_PSparties = "Socialists (18.9), Gaullists (33), Democratic Centre (14.1), Republican Independents (5.5), Moderates (1.9), Centrist Radicals (1.3)" if countryelection == 114
replace string_CPparties = "Other (0.4, Other)" if countryelection == 114
replace string_SCparties = "United Socialists (2.1)" if countryelection == 114
replace string_ASparties = "Communists (22.5, Com), 'Extreme Right' (0.2, ER), 'Extreme Left' (0.1, EL)" if countryelection == 114

replace voteper_PSparties = 74.7 if countryelection == 114
replace voteper_CPparties =  0.4 if countryelection == 114
replace voteper_SCparties =  2.1  if countryelection == 114
replace voteper_ASparties = 22.8 if countryelection == 114

replace voteper_EL_ASP = 22.6     if countryelection == 114
replace voteper_RL_ASP = .       if countryelection == 114
replace voteper_ER_ASP = 0.2        if countryelection == 114
replace voteper_RR_ASP = .       if countryelection == 114
replace voteper_GREEN_ASP = .    if countryelection == 114
replace voteper_PIRATE_ASP = .     if countryelection == 114
replace voteper_MISC_POP_ASP = .  if countryelection == 114
replace voteper_SEC_NAT_ASP = .   if countryelection == 114
replace voteper_REL_ASP =.       if countryelection == 114
replace voteper_OTHERR_ASP = .   if countryelection == 114
replace voteper_OTHERL_ASP = .    if countryelection == 114

*1968*
replace string_PSparties = "Socialists (16.6), Gaullists (38.1), Centre of Progress and Modern Democracy (10.5), Centre Radicals (0.4), Moderates (1.2), Republican Independents/Union of Democrats (8.4)" if countryelection == 115
replace string_CPparties = "Other (0.9, Other)" if countryelection == 115
replace string_SCparties = "Communists (20.1, Com)" if countryelection == 115
replace string_ASparties = "Extreme Right' (0.1, ER), 'Extreme Left' (0.1, Com), United Socialists (3.9, RL)" if countryelection == 115

replace voteper_PSparties = 74.7 if countryelection == 115
replace voteper_CPparties =  1.1 if countryelection == 115
replace voteper_SCparties = 20.1 if countryelection == 115
replace voteper_ASparties =  4.1 if countryelection == 115

replace voteper_EL_ASP = 0.1     if countryelection == 115
replace voteper_RL_ASP = 3.9       if countryelection == 115
replace voteper_ER_ASP = 0.1        if countryelection == 115
replace voteper_RR_ASP = .       if countryelection == 115
replace voteper_GREEN_ASP = .    if countryelection == 115
replace voteper_PIRATE_ASP = .     if countryelection == 115
replace voteper_MISC_POP_ASP = .  if countryelection == 115
replace voteper_SEC_NAT_ASP = .   if countryelection == 115
replace voteper_REL_ASP =.       if countryelection == 115
replace voteper_OTHERR_ASP = .   if countryelection == 115
replace voteper_OTHERL_ASP = .   if countryelection == 115

*1973*
replace string_PSparties = "Socialists (19.1), Gaullists  (24.5), Rally of the Republican Lefts (15), Indepedndent Republicans (0.6),Progressive Republicans (1.2), Moderates (3.4), Reformist Movement (9.2), Dem Centre (3.5), Republican Independents/Union of Democrats (6.6), Republican Radicals (4.1)" if countryelection == 116
replace string_CPparties = "Other (1.5, Other)" if countryelection == 116
replace string_SCparties = "Communists (21.4, Com)" if countryelection == 116
replace string_ASparties = "National Front' (0.5, RR), 'Extreme Left' (0.4, Com), United Socialists (2, RL), Workers' Struggle (0.8, Com), Extreme Right (0.5)" if countryelection == 116

replace voteper_PSparties = 72.9  if countryelection == 116
replace voteper_CPparties =  1.5  if countryelection == 116
replace voteper_SCparties = 21.4  if countryelection == 116
replace voteper_ASparties =  4.2  if countryelection == 116

replace voteper_EL_ASP = 1.2     if countryelection == 116
replace voteper_RL_ASP = 2.0     if countryelection == 116
replace voteper_ER_ASP = 0.5     if countryelection == 116
replace voteper_RR_ASP = 0.5     if countryelection == 116
replace voteper_GREEN_ASP = .    if countryelection == 116
replace voteper_PIRATE_ASP = .   if countryelection == 116
replace voteper_MISC_POP_ASP = . if countryelection == 116
replace voteper_SEC_NAT_ASP = .  if countryelection == 116
replace voteper_REL_ASP =.       if countryelection == 116
replace voteper_OTHERR_ASP = .   if countryelection == 116
replace voteper_OTHERL_ASP = .   if countryelection == 116

*1978*
replace string_PSparties = "Socialists (22.8), UDF (19, Lib), Gaullists (22.5), Movement of Radical Left (2.2), National Centre of Independents (1.9), Presidential Majority (1.3)" if countryelection == 117
replace string_CPparties = "Other (3.6, Other)" if countryelection == 117
replace string_SCparties = "Communists (20.6, Com)" if countryelection == 117
replace string_ASparties = "Greens (2, Green), Extreme Right' (0.5, ER), National Front (0.3, RR), 'Extreme Left' (0.5, Com), United Socialists (1.1 LW), Workers' Struggle (1.7, Com)" if countryelection == 117

replace voteper_PSparties = 69.7 if countryelection == 117
replace voteper_CPparties =  3.6 if countryelection == 117
replace voteper_SCparties = 20.6 if countryelection == 117
replace voteper_ASparties =  6.1 if countryelection == 117

replace voteper_EL_ASP = 2.2     if countryelection == 117
replace voteper_RL_ASP = .       if countryelection == 117
replace voteper_ER_ASP = 0.5        if countryelection == 117
replace voteper_RR_ASP = 0.3       if countryelection == 117
replace voteper_GREEN_ASP = 2    if countryelection == 117
replace voteper_PIRATE_ASP = .     if countryelection == 117
replace voteper_MISC_POP_ASP = .  if countryelection == 117
replace voteper_SEC_NAT_ASP = .   if countryelection == 117
replace voteper_REL_ASP =.       if countryelection == 117
replace voteper_OTHERR_ASP = .   if countryelection == 117
replace voteper_OTHERL_ASP = 1.1    if countryelection == 117

*1981*
replace string_PSparties = "Socialists (36), UDF (2.2, Lib), Gaullists (20.7), Radical Party (9.2), Dem Soc Movement (0.5), Democratic Centre (5.3), Radical Socialists (1.4), Radical Left Movement (1.1), Union of Democratic Forces (2.2), National Centre for Independents (2.6)" if countryelection == 118
replace string_CPparties = "Other (2, Other)" if countryelection == 118
replace string_SCparties = "Communists (16.1, Com)" if countryelection == 118
replace string_ASparties = "Greens (2.2, Green), Extreme Right' (0.1, ER), National Front (0.2, RR), 'Extreme Left' (0.1, Com), United Socialists (0.7, LW), Workers' Struggle (0.4, Com)" if countryelection == 118

replace voteper_PSparties = 81.2 if countryelection == 118
replace voteper_CPparties =  2.0   if countryelection == 118
replace voteper_SCparties = 16.1 if countryelection == 118
replace voteper_ASparties =  3.7 if countryelection == 118

replace voteper_EL_ASP = 0.5     if countryelection == 118
replace voteper_RL_ASP = .       if countryelection == 118
replace voteper_ER_ASP = 0.1        if countryelection == 118
replace voteper_RR_ASP = 0.2       if countryelection == 118
replace voteper_GREEN_ASP = 2.2    if countryelection == 118
replace voteper_PIRATE_ASP = .     if countryelection == 118
replace voteper_MISC_POP_ASP = .  if countryelection == 118
replace voteper_SEC_NAT_ASP = .   if countryelection == 118
replace voteper_REL_ASP =.       if countryelection == 118
replace voteper_OTHERR_ASP = .   if countryelection == 118
replace voteper_OTHERL_ASP = 0.7    if countryelection == 118

*1986*
replace string_PSparties = "Socialists (30.8), UDF (31.2), Gaullist (11.5), Left Radicals (0.8)" if countryelection == 119
replace string_CPparties = "Other (5.6, Other)" if countryelection == 119
replace string_SCparties = "NA" if countryelection == 119
replace string_ASparties = "Communists (9.7, Com), Front National (9.8, RR), Greens (1.2, Green), Extreme Right' (0.2, ER), 'Extreme Left' (0.9, Com), Workers' Struggle (0.6, Com)" if countryelection == 119

replace voteper_PSparties = 74.3  if countryelection == 119
replace voteper_CPparties =  3.3 if countryelection == 119
replace voteper_SCparties =  0  if countryelection == 119
replace voteper_ASparties = 22.4  if countryelection == 119

replace voteper_EL_ASP = 11.2     if countryelection == 119
replace voteper_RL_ASP = .       if countryelection == 119
replace voteper_ER_ASP = 0.2        if countryelection == 119
replace voteper_RR_ASP = 9.8       if countryelection == 119
replace voteper_GREEN_ASP = 1.2    if countryelection == 119
replace voteper_PIRATE_ASP = .     if countryelection == 119
replace voteper_MISC_POP_ASP = .  if countryelection == 119
replace voteper_SEC_NAT_ASP = .   if countryelection == 119
replace voteper_REL_ASP =.       if countryelection == 119
replace voteper_OTHERR_ASP = .   if countryelection == 119
replace voteper_OTHERL_ASP = .    if countryelection == 119

*1988*
replace string_PSparties = "Socialists (34.9), UDF (18.8), Gaullist (19.2), Left Radicals (1.2)" if countryelection == 120
replace string_CPparties = "Other (4.0, Other)" if countryelection == 120
replace string_SCparties = "NA" if countryelection == 120
replace string_ASparties = "Communists (11.2, Com), Front National (9.8, RR), Greens (0.4, Green), Extreme Right' (0.1, ER), 'Extreme Left' (0.4, Com)" if countryelection == 120

replace voteper_PSparties = 74.1 if countryelection == 120
replace voteper_CPparties =  4.0 if countryelection == 120
replace voteper_SCparties =  0   if countryelection == 120
replace voteper_ASparties = 21.9 if countryelection == 120

replace voteper_EL_ASP = 11.6     if countryelection == 120
replace voteper_RL_ASP = .       if countryelection == 120
replace voteper_ER_ASP = 0.1        if countryelection == 120
replace voteper_RR_ASP = 9.8       if countryelection == 120
replace voteper_GREEN_ASP = 0.4    if countryelection == 120
replace voteper_PIRATE_ASP = .     if countryelection == 120
replace voteper_MISC_POP_ASP = .  if countryelection == 120
replace voteper_SEC_NAT_ASP = .   if countryelection == 120
replace voteper_REL_ASP =.       if countryelection == 120
replace voteper_OTHERR_ASP = .   if countryelection == 120
replace voteper_OTHERL_ASP = .    if countryelection == 120

*1993*
replace string_PSparties = "Socialists (17.7), UDF (19), Gaullist (20.2), Left Radicals (1)" if countryelection == 121
replace string_CPparties = "Other (7.3, Other), Generation Ecology (3.7, Green)" if countryelection == 121
replace string_SCparties = "NA" if countryelection == 121
replace string_ASparties = "Communists (9.1, Com), Front National (12.7, RR), The Greens (7.3, Green), Extreme Right' (0.3, ER), 'Extreme Left' (1.7, Com)" if countryelection == 121

replace voteper_PSparties =  57.9 if countryelection == 121
replace voteper_CPparties =  11.0 if countryelection == 121
replace voteper_SCparties =  0    if countryelection == 121
replace voteper_ASparties =  31.1 if countryelection == 121

replace voteper_EL_ASP = 10.8     if countryelection == 121
replace voteper_RL_ASP = .       if countryelection == 121
replace voteper_ER_ASP = 0.3        if countryelection == 121
replace voteper_RR_ASP = 12.7       if countryelection == 121
replace voteper_GREEN_ASP = 7.3    if countryelection == 121
replace voteper_PIRATE_ASP = .     if countryelection == 121
replace voteper_MISC_POP_ASP = .  if countryelection == 121
replace voteper_SEC_NAT_ASP = .   if countryelection == 121
replace voteper_REL_ASP =.       if countryelection == 121
replace voteper_OTHERR_ASP = .   if countryelection == 121
replace voteper_OTHERL_ASP = .    if countryelection == 121

*1997*
replace string_PSparties = "Socialists (23.8), UDF (14.4), Gaullist (15.5), Radical Left Movement (1.5), Greens (6.9, Green)" if countryelection == 122
replace string_CPparties = "Other (10.1, Other)" if countryelection == 122
replace string_SCparties = "NA" if countryelection == 122
replace string_ASparties = "Communists (9.9, RL), Front National (15.2, RR), Extreme Right' (0.1, ER), 'Extreme Left' (2.6, Com)" if countryelection == 122

replace voteper_PSparties = 62.1  if countryelection == 122
replace voteper_CPparties = 10.1  if countryelection == 122
replace voteper_SCparties =  0   if countryelection == 122
replace voteper_ASparties = 27.8  if countryelection == 122

replace voteper_EL_ASP = 2.6     if countryelection == 122
replace voteper_RL_ASP = 9.9       if countryelection == 122
replace voteper_ER_ASP = 0.1        if countryelection == 122
replace voteper_RR_ASP = 15.2      if countryelection == 122
replace voteper_GREEN_ASP = .    if countryelection == 122
replace voteper_PIRATE_ASP = .     if countryelection == 122
replace voteper_MISC_POP_ASP = .  if countryelection == 122
replace voteper_SEC_NAT_ASP = .   if countryelection == 122
replace voteper_REL_ASP =.       if countryelection == 122
replace voteper_OTHERR_ASP = .   if countryelection == 122
replace voteper_OTHERL_ASP = .    if countryelection == 122

*2002*
replace string_PSparties = "Socialists (24.1), UDF (4.9), Gaullist (33.3), Greens (4.5, Green) Radical Left  (1.5)" if countryelection == 123
replace string_CPparties = "Other (7, Other), Hunting, Fishing .. (1.7, Oth)" if countryelection == 123
replace string_SCparties = "Communists (4.8, RL), MPF (0.8, RR)" if countryelection == 123
replace string_ASparties = "Front National (11.3, RR), Revolutionary Communists (1.3, EL), National Republican Movement (1.1, RR), Movement for France (0.8, RR), Workers' Struggle (1.2, RL), Extreme Right' (0.2, ER), 'Extreme Left' (0.3, Com), Other Greens (1.2)" if countryelection == 123

replace voteper_PSparties = 68.3  if countryelection == 123
replace voteper_CPparties =  8.7 if countryelection == 123
replace voteper_SCparties =  5.6 if countryelection == 123
replace voteper_ASparties = 17.4  if countryelection == 123

replace voteper_EL_ASP =  1.6     if countryelection == 123
replace voteper_RL_ASP = 1.2       if countryelection == 123
replace voteper_ER_ASP = 0.2       if countryelection == 123
replace voteper_RR_ASP = 13.2  if countryelection == 123
replace voteper_GREEN_ASP = 1.2    if countryelection == 123
replace voteper_PIRATE_ASP = .     if countryelection == 123
replace voteper_MISC_POP_ASP = .  if countryelection == 123
replace voteper_SEC_NAT_ASP = .   if countryelection == 123
replace voteper_REL_ASP =.       if countryelection == 123
replace voteper_OTHERR_ASP = .   if countryelection == 123
replace voteper_OTHERL_ASP = .    if countryelection == 123

*2007*
replace string_PSparties = "Socialists (24.7), UMP (39.5), 	UDF (7.6), Greens (3.3, Green), New Centre (2.4), Party of the Radical Left (1.3)" if countryelection == 124
replace string_CPparties = "Other (4.5, Other), Hunting, Fishing .. (0.8, Oth)" if countryelection == 124
replace string_SCparties = "MPF (1.2, RR)" if countryelection == 124
replace string_ASparties = "Communists (4.3, RL), Front National (4.3, RR), Deep Greens (0.8, Green), Extreme Right' (0.4, ER), 'Extreme Left' (3.4, Com)" if countryelection == 124

replace voteper_PSparties = 77.8  if countryelection == 124
replace voteper_CPparties =  7.8 if countryelection == 124
replace voteper_SCparties =  1.2 if countryelection == 124
replace voteper_ASparties = 13.2 if countryelection == 124

replace voteper_EL_ASP = 3.4     if countryelection == 124
replace voteper_RL_ASP = 4.3       if countryelection == 124
replace voteper_ER_ASP = 0.4        if countryelection == 124
replace voteper_RR_ASP = 4.3      if countryelection == 124
replace voteper_GREEN_ASP = 0.8    if countryelection == 124
replace voteper_PIRATE_ASP = .     if countryelection == 124
replace voteper_MISC_POP_ASP = .  if countryelection == 124
replace voteper_SEC_NAT_ASP = .   if countryelection == 124
replace voteper_REL_ASP =.       if countryelection == 124
replace voteper_OTHERR_ASP = .   if countryelection == 124
replace voteper_OTHERL_ASP = .    if countryelection == 124

*2012*
replace string_PSparties = "Socialists (29.4), UMP (27.1), New Centre (2.2), Greens (5.5, Green), Left Radicals (1.7), Centre Alliance (0.6), Radicals (1.2)" if countryelection == 125
replace string_CPparties = "Centre for France (1.8, Lib), Other Left (3.4, Other), Other Right (3.5), Regionalists (0.6), Other (0.5)" if countryelection == 125
replace string_SCparties = "NA" if countryelection == 125
replace string_ASparties = "Front National (13.6, RR), Left Front (6.9, RL), Deep Greens (1, Green), Extreme Right' (0.2, ER), 'Extreme Left' (1, Com)" if countryelection == 125

replace voteper_PSparties = 67.7  if countryelection == 125
replace voteper_CPparties =  9.8  if countryelection == 125
replace voteper_SCparties =  0    if countryelection == 125
replace voteper_ASparties = 22.7 if countryelection == 125

replace voteper_EL_ASP = 1     if countryelection == 125
replace voteper_RL_ASP = 6.9       if countryelection == 125
replace voteper_ER_ASP = 0.2        if countryelection == 125
replace voteper_RR_ASP = 13.6      if countryelection == 125
replace voteper_GREEN_ASP = 1    if countryelection == 125
replace voteper_PIRATE_ASP = .     if countryelection == 125
replace voteper_MISC_POP_ASP = .  if countryelection == 125
replace voteper_SEC_NAT_ASP = .   if countryelection == 125
replace voteper_REL_ASP =.       if countryelection == 125
replace voteper_OTHERR_ASP = .   if countryelection == 125
replace voteper_OTHERL_ASP = .    if countryelection == 125



******************************** Germany **********************************************

***** Source:  Nohlen and Stover (2010) [1953-2005]
*              Bundeswahlleiter.de - Federal Returning Officer Website [2009-2013]


*1953*
replace string_PSparties = "CDU (36.4), CSU (8.8), FDP (9.5)," if countryelection == 126
replace string_CPparties = "Indep/Other (0.5, Oth), All German Bloc (5.9, Oth),  All German People's (1.2, LW), SPD (28.8, sdp), Centre (0.8, Centre)" if countryelection == 126
replace string_SCparties = "DP (3.3)" if countryelection == 126
replace string_ASparties = "ADF-DKP/KPD (2.2, Com), German Rights Party (1.1, ER), Bavaria Party (1.7, Sec)" if countryelection == 126

replace voteper_PSparties = 54.7  if countryelection == 126
replace voteper_CPparties = 37.0  if countryelection == 126
replace voteper_SCparties =  3.3  if countryelection == 126
replace voteper_ASparties =  5    if countryelection == 126

replace voteper_EL_ASP = 2.2    if countryelection == 126
replace voteper_RL_ASP = .       if countryelection == 126
replace voteper_ER_ASP = 1.1        if countryelection == 126
replace voteper_RR_ASP = .      if countryelection == 126
replace voteper_GREEN_ASP = .    if countryelection == 126
replace voteper_PIRATE_ASP = .     if countryelection == 126
replace voteper_MISC_POP_ASP = .  if countryelection == 126
replace voteper_SEC_NAT_ASP = 1.7   if countryelection == 126
replace voteper_REL_ASP =.       if countryelection == 126
replace voteper_OTHERR_ASP = .   if countryelection == 126
replace voteper_OTHERL_ASP = .    if countryelection == 126

*1957*
replace string_PSparties = "CDU (39.7), CSU (10.5), FDP (7.7), All German Bloc (4.6), " if countryelection == 127
replace string_CPparties = "Indep/Other (0.5, Oth),  SPD (31.8, sdp), Centre (0.9, Centre)" if countryelection == 127
replace string_SCparties = "DP (3.3)" if countryelection == 127
replace string_ASparties = "German Rights Party (1, ER)" if countryelection == 127

replace voteper_PSparties =  62.5  if countryelection == 127
replace voteper_CPparties =  33.2  if countryelection == 127
replace voteper_SCparties =   3.3  if countryelection == 127
replace voteper_ASparties =  1     if countryelection == 127

replace voteper_EL_ASP = .    if countryelection == 127
replace voteper_RL_ASP = .       if countryelection == 127
replace voteper_ER_ASP = 1        if countryelection == 127
replace voteper_RR_ASP = .      if countryelection == 127
replace voteper_GREEN_ASP = .    if countryelection == 127
replace voteper_PIRATE_ASP = .     if countryelection == 127
replace voteper_MISC_POP_ASP = .  if countryelection == 127
replace voteper_SEC_NAT_ASP = .   if countryelection == 127
replace voteper_REL_ASP =.       if countryelection == 127
replace voteper_OTHERR_ASP = .   if countryelection == 127
replace voteper_OTHERL_ASP = .    if countryelection == 127

*1961*
replace string_PSparties = "CDU (35.8), CSU (9.6), FDP (12.8), " if countryelection == 128
replace string_CPparties = "Indep/Other (0.2, Oth), SPD (36.2, sdp)" if countryelection == 128
replace string_SCparties = "DP (2.7)" if countryelection == 128
replace string_ASparties = "German Rights Party (0.8, ER), Peace Union (1.9, OL)" if countryelection == 128

replace voteper_PSparties =  58.2 if countryelection == 128
replace voteper_CPparties =  36.4 if countryelection == 128
replace voteper_SCparties =   2.7 if countryelection == 128
replace voteper_ASparties =   2.7 if countryelection == 128

replace voteper_EL_ASP = .    if countryelection == 128
replace voteper_RL_ASP = .       if countryelection == 128
replace voteper_ER_ASP = 0.8        if countryelection == 128
replace voteper_RR_ASP = .      if countryelection == 128
replace voteper_GREEN_ASP = .    if countryelection == 128
replace voteper_PIRATE_ASP = .     if countryelection == 128
replace voteper_MISC_POP_ASP = .  if countryelection == 128
replace voteper_SEC_NAT_ASP = .   if countryelection == 128
replace voteper_REL_ASP =.       if countryelection == 128
replace voteper_OTHERR_ASP = .   if countryelection == 128
replace voteper_OTHERL_ASP = 1.9    if countryelection == 128

*1965*
replace string_PSparties = "CDU (38), CSU (9.6), FDP (9.5), " if countryelection == 129
replace string_CPparties = "Indep/Other (0.3, Oth), SPD (39.3, sdp)" if countryelection == 129
replace string_SCparties = "NA" if countryelection == 129
replace string_ASparties = "National Democratic Party (2, ER), Peace Union (1.3, OL)" if countryelection == 129

replace voteper_PSparties = 57.1  if countryelection == 129
replace voteper_CPparties = 39.6  if countryelection == 129
replace voteper_SCparties =  0    if countryelection == 129
replace voteper_ASparties =  3.3 if countryelection == 129

replace voteper_EL_ASP = .    if countryelection == 129
replace voteper_RL_ASP = .       if countryelection == 129
replace voteper_ER_ASP = 2        if countryelection == 129
replace voteper_RR_ASP = .      if countryelection == 129
replace voteper_GREEN_ASP = .    if countryelection == 129
replace voteper_PIRATE_ASP = .     if countryelection == 129
replace voteper_MISC_POP_ASP = .  if countryelection == 129
replace voteper_SEC_NAT_ASP = .   if countryelection == 129
replace voteper_REL_ASP =.       if countryelection == 129
replace voteper_OTHERR_ASP = .   if countryelection == 129
replace voteper_OTHERL_ASP = 1.3    if countryelection == 129

*1969*
replace string_PSparties = "CDU (36.6), CSU (9.5), FDP (5.8), SPD (42.7)" if countryelection == 130
replace string_CPparties = "Indep/Other (0.4, Oth)" if countryelection == 130
replace string_SCparties = "NA" if countryelection == 130
replace string_ASparties = "National Democratic Party (4.3, ER), Democratic Action (0.6, Com), Bavaria Party (0.2, Sec)" if countryelection == 130

replace voteper_PSparties =  94.6 if countryelection == 130
replace voteper_CPparties =   0.4 if countryelection == 130
replace voteper_SCparties =   0   if countryelection == 130
replace voteper_ASparties =   5.1 if countryelection == 130

replace voteper_EL_ASP = 0.6    if countryelection == 130
replace voteper_RL_ASP = .       if countryelection == 130
replace voteper_ER_ASP = 4.3        if countryelection == 130
replace voteper_RR_ASP = .      if countryelection == 130
replace voteper_GREEN_ASP = .    if countryelection == 130
replace voteper_PIRATE_ASP = .     if countryelection == 130
replace voteper_MISC_POP_ASP = .  if countryelection == 130
replace voteper_SEC_NAT_ASP = 0.2   if countryelection == 130
replace voteper_REL_ASP =.       if countryelection == 130
replace voteper_OTHERR_ASP = .   if countryelection == 130
replace voteper_OTHERL_ASP = .    if countryelection == 130

*1972*
replace string_PSparties = "CDU (35.2), CSU (9.7), FDP (8.4), SPD (45.8)" if countryelection == 131
replace string_CPparties = "Indep/Other (0.1, Oth)" if countryelection == 131
replace string_SCparties = "NA" if countryelection == 131
replace string_ASparties = "National Democratic Party (0.6, ER), Democratic Action (0.3, Com)" if countryelection == 131

replace voteper_PSparties = 99.1  if countryelection == 131
replace voteper_CPparties =  0.1 if countryelection == 131
replace voteper_SCparties =  0    if countryelection == 131
replace voteper_ASparties =  0.9 if countryelection == 131

replace voteper_EL_ASP = 0.3    if countryelection == 131
replace voteper_RL_ASP = .       if countryelection == 131
replace voteper_ER_ASP = 0.6        if countryelection == 131
replace voteper_RR_ASP = .      if countryelection == 131
replace voteper_GREEN_ASP = .    if countryelection == 131
replace voteper_PIRATE_ASP = .     if countryelection == 131
replace voteper_MISC_POP_ASP = .  if countryelection == 131
replace voteper_SEC_NAT_ASP = .   if countryelection == 131
replace voteper_REL_ASP =.       if countryelection == 131
replace voteper_OTHERR_ASP = .   if countryelection == 131
replace voteper_OTHERL_ASP = .    if countryelection == 131

*1976*
replace string_PSparties = "CDU (38), CSU (10.6), FDP (7.9), SPD (42.6)" if countryelection == 132
replace string_CPparties = "Indep/Other (0.2, Oth)" if countryelection == 132
replace string_SCparties = "NA" if countryelection == 132
replace string_ASparties = "National Democratic Party (0.3, ER), Democratic Action (0.3, Com), Communists (0.1)" if countryelection == 132

replace voteper_PSparties = 99.1  if countryelection == 132
replace voteper_CPparties =  0.2 if countryelection == 132
replace voteper_SCparties =  0    if countryelection == 132
replace voteper_ASparties =  0.7 if countryelection == 132

replace voteper_EL_ASP = 0.4    if countryelection == 132
replace voteper_RL_ASP = .       if countryelection == 132
replace voteper_ER_ASP = 0.3        if countryelection == 132
replace voteper_RR_ASP = .      if countryelection == 132
replace voteper_GREEN_ASP = .    if countryelection == 132
replace voteper_PIRATE_ASP = .     if countryelection == 132
replace voteper_MISC_POP_ASP = .  if countryelection == 132
replace voteper_SEC_NAT_ASP = .   if countryelection == 132
replace voteper_REL_ASP =.       if countryelection == 132
replace voteper_OTHERR_ASP = .   if countryelection == 132
replace voteper_OTHERL_ASP = .    if countryelection == 132

*1980*
replace string_PSparties = "CDU (34.2), CSU (10.3), FDP (10.6), SPD (42.9)" if countryelection == 133
replace string_CPparties = "Indep/Other (0.1, Oth)" if countryelection == 133
replace string_SCparties = "NA" if countryelection == 133
replace string_ASparties = "National Democratic Party (0.2, ER), Democratic Action (0.2, Com), Greens (1.5, Green)" if countryelection == 133

replace voteper_PSparties = 98  if countryelection == 133
replace voteper_CPparties =  0.1 if countryelection == 133
replace voteper_SCparties =  0    if countryelection == 133
replace voteper_ASparties =  1.9 if countryelection == 133

replace voteper_EL_ASP = 0.2    if countryelection == 133
replace voteper_RL_ASP = .       if countryelection == 133
replace voteper_ER_ASP = 0.2        if countryelection == 133
replace voteper_RR_ASP = .      if countryelection == 133
replace voteper_GREEN_ASP = 1.5    if countryelection == 133
replace voteper_PIRATE_ASP = .     if countryelection == 133
replace voteper_MISC_POP_ASP = .  if countryelection == 133
replace voteper_SEC_NAT_ASP = .   if countryelection == 133
replace voteper_REL_ASP =.       if countryelection == 133
replace voteper_OTHERR_ASP = .   if countryelection == 133
replace voteper_OTHERL_ASP = .    if countryelection == 133

*1983*
replace string_PSparties = "CDU (38.2), CSU (10.6), FDP (7), SPD (38.2)" if countryelection == 134
replace string_CPparties = "Indep/Other (0.1, Oth)" if countryelection == 134
replace string_SCparties = "NA" if countryelection == 134
replace string_ASparties = "National Democratic Party (0.2, ER), Democratic Action (0.2, Com), Greens (5.6, Green)" if countryelection == 134

replace voteper_PSparties = 94  if countryelection == 134
replace voteper_CPparties =  0.1 if countryelection == 134
replace voteper_SCparties =  0    if countryelection == 134
replace voteper_ASparties =  6  if countryelection == 134

replace voteper_EL_ASP = 0.2    if countryelection == 134
replace voteper_RL_ASP = .       if countryelection == 134
replace voteper_ER_ASP = 0.2        if countryelection == 134
replace voteper_RR_ASP = .      if countryelection == 134
replace voteper_GREEN_ASP = 5.6    if countryelection == 134
replace voteper_PIRATE_ASP = .     if countryelection == 134
replace voteper_MISC_POP_ASP = .  if countryelection == 134
replace voteper_SEC_NAT_ASP = .   if countryelection == 134
replace voteper_REL_ASP =.       if countryelection == 134
replace voteper_OTHERR_ASP = .   if countryelection == 134
replace voteper_OTHERL_ASP = .    if countryelection == 134

*1987*
replace string_PSparties = "CDU (34.5), CSU (9.8), FDP (9.1), SPD (37)" if countryelection == 135
replace string_CPparties = "Indep/Other (0.6, Oth), Centre (0.1, Lib)" if countryelection == 135
replace string_SCparties = "NA" if countryelection == 135
replace string_ASparties = "National Democratic Party (0.6, ER), Greens (8.3, Green), Bavaria Party (0.1, Sec)" if countryelection == 135

replace voteper_PSparties = 90.4  if countryelection == 135
replace voteper_CPparties =  0.7  if countryelection == 135
replace voteper_SCparties =  0    if countryelection == 135
replace voteper_ASparties =  9   if countryelection == 135

replace voteper_EL_ASP = .    if countryelection == 135
replace voteper_RL_ASP = .       if countryelection == 135
replace voteper_ER_ASP = 0.6        if countryelection == 135
replace voteper_RR_ASP = .      if countryelection == 135
replace voteper_GREEN_ASP = 8.3    if countryelection == 135
replace voteper_PIRATE_ASP = .     if countryelection == 135
replace voteper_MISC_POP_ASP = .  if countryelection == 135
replace voteper_SEC_NAT_ASP = 0.1   if countryelection == 135
replace voteper_REL_ASP =.       if countryelection == 135
replace voteper_OTHERR_ASP = .   if countryelection == 135
replace voteper_OTHERL_ASP = .    if countryelection == 135

*1990*
replace string_PSparties = "CDU (36.7), CSU (7.1), FDP (11), SPD (33.5)" if countryelection == 136
replace string_CPparties = "Indep/Other (0.7, Oth), ODP (0.4, Green), Greys (0.8, Pens)" if countryelection == 136
replace string_SCparties = "NA" if countryelection == 136
replace string_ASparties = "National Democratic Party (0.3, ER), Greens (5, Green), Die Linke (2.4, RL), Republicans (2.1, RR)" if countryelection == 136

replace voteper_PSparties = 88.3  if countryelection == 136
replace voteper_CPparties =  1.9 if countryelection == 136
replace voteper_SCparties =  0    if countryelection == 136
replace voteper_ASparties =  9.8 if countryelection == 136

replace voteper_EL_ASP = .    if countryelection == 136
replace voteper_RL_ASP = 2.4       if countryelection == 136
replace voteper_ER_ASP = 0.3        if countryelection == 136
replace voteper_RR_ASP = 2.1      if countryelection == 136
replace voteper_GREEN_ASP = 5    if countryelection == 136
replace voteper_PIRATE_ASP = .     if countryelection == 136
replace voteper_MISC_POP_ASP = .  if countryelection == 136
replace voteper_SEC_NAT_ASP = .   if countryelection == 136
replace voteper_REL_ASP =.       if countryelection == 136
replace voteper_OTHERR_ASP = .   if countryelection == 136
replace voteper_OTHERL_ASP = .    if countryelection == 136

*1994*
replace string_PSparties = "CDU (34.2), CSU (7.3), FDP (6.9), SPD (36.4)" if countryelection == 137
replace string_CPparties = "Indep/Other (0.5, Oth), ODP (0.4, Green), Greens (7.3, Green), Greys (0.5, Pens)" if countryelection == 137
replace string_SCparties = "NA" if countryelection == 137
replace string_ASparties = "National Democratic Party (0.3, ER), Die Linke (4.4, RL), Republicans (1.9, RR)" if countryelection == 137

replace voteper_PSparties = 84.8  if countryelection == 137
replace voteper_CPparties =  8.7 if countryelection == 137
replace voteper_SCparties =  0    if countryelection == 137
replace voteper_ASparties =  6.6 if countryelection == 137

replace voteper_EL_ASP = .    if countryelection == 137
replace voteper_RL_ASP = 4.4       if countryelection == 137
replace voteper_ER_ASP = 0.3        if countryelection == 137
replace voteper_RR_ASP = 1.9      if countryelection == 137
replace voteper_GREEN_ASP = .    if countryelection == 137
replace voteper_PIRATE_ASP = .     if countryelection == 137
replace voteper_MISC_POP_ASP = .  if countryelection == 137
replace voteper_SEC_NAT_ASP = .   if countryelection == 137
replace voteper_REL_ASP =.       if countryelection == 137
replace voteper_OTHERR_ASP = .   if countryelection == 137
replace voteper_OTHERL_ASP = .    if countryelection == 137

*1998*
replace string_PSparties = "CDU (28.4), CSU (6.7), FDP (6.2), SPD (40.9)" if countryelection == 138
replace string_CPparties = "Indep/Other (1.2, Oth), ODP (0.2, Green), Greens (6.7, Green), Greys (0.3, Pens), ProDM (0.9, Oth)" if countryelection == 138
replace string_SCparties = "NA" if countryelection == 138
replace string_ASparties = "National Democratic Party (0.3, ER), German People's Union (1.2, RR), Die Linke (5.1, RL), Republicans (1.8, RR)" if countryelection == 138

replace voteper_PSparties = 82.2  if countryelection == 138
replace voteper_CPparties =  9.3  if countryelection == 138
replace voteper_SCparties =  0    if countryelection == 138
replace voteper_ASparties =  8.4  if countryelection == 138

replace voteper_EL_ASP = .    if countryelection == 138
replace voteper_RL_ASP = 5.1       if countryelection == 138
replace voteper_ER_ASP = 0.3        if countryelection == 138
replace voteper_RR_ASP = 3      if countryelection == 138
replace voteper_GREEN_ASP = .    if countryelection == 138
replace voteper_PIRATE_ASP = .     if countryelection == 138
replace voteper_MISC_POP_ASP = .  if countryelection == 138
replace voteper_SEC_NAT_ASP = .   if countryelection == 138
replace voteper_REL_ASP =.       if countryelection == 138
replace voteper_OTHERR_ASP = .   if countryelection == 138
replace voteper_OTHERL_ASP = .    if countryelection == 138

*2002*
replace string_PSparties = "CDU (29.5), CSU (9), FDP (7.4), SPD (38.5), Greens (8.6, Green)" if countryelection == 139
replace string_CPparties = "Indep/Other (1.8, Oth), ODP (0.1, Green), Greys (0.2, Pens)" if countryelection == 139
replace string_SCparties = "NA" if countryelection == 139
replace string_ASparties = "National Democratic Party (0.4, ER), Die Linke (4, RL), Republicans (0.6, RR)" if countryelection == 139

replace voteper_PSparties =  93 if countryelection == 139
replace voteper_CPparties =  2.1 if countryelection == 139
replace voteper_SCparties =  0    if countryelection == 139
replace voteper_ASparties =  5 if countryelection == 139

replace voteper_EL_ASP = .    if countryelection == 139
replace voteper_RL_ASP = 4       if countryelection == 139
replace voteper_ER_ASP = 0.4        if countryelection == 139
replace voteper_RR_ASP = 0.6      if countryelection == 139
replace voteper_GREEN_ASP = .    if countryelection == 139
replace voteper_PIRATE_ASP = .     if countryelection == 139
replace voteper_MISC_POP_ASP = .  if countryelection == 139
replace voteper_SEC_NAT_ASP = .   if countryelection == 139
replace voteper_REL_ASP =.       if countryelection == 139
replace voteper_OTHERR_ASP = .   if countryelection == 139
replace voteper_OTHERL_ASP = .    if countryelection == 139

*2005*
replace string_PSparties = "CDU (27.8), CSU (7.4), FDP (9.8), SPD (34.2), Greens (8.1)" if countryelection == 140
replace string_CPparties = "Indep/Other (1.4, Oth), Greys (0.4, Pens)" if countryelection == 140
replace string_SCparties = "NA" if countryelection == 140
replace string_ASparties = "National Democratic Party (1.6, ER), Die Linke (8.7, RL), Republicans (0.6, RR)" if countryelection == 140

replace voteper_PSparties = 87.3  if countryelection == 140
replace voteper_CPparties =  1.8 if countryelection == 140
replace voteper_SCparties =  0    if countryelection == 140
replace voteper_ASparties = 10.9 if countryelection == 140

replace voteper_EL_ASP = .    if countryelection == 140
replace voteper_RL_ASP = 8.7       if countryelection == 140
replace voteper_ER_ASP = 1.6        if countryelection == 140
replace voteper_RR_ASP = 0.6      if countryelection == 140
replace voteper_GREEN_ASP = .    if countryelection == 140
replace voteper_PIRATE_ASP = .     if countryelection == 140
replace voteper_MISC_POP_ASP = .  if countryelection == 140
replace voteper_SEC_NAT_ASP = .   if countryelection == 140
replace voteper_REL_ASP =.       if countryelection == 140
replace voteper_OTHERR_ASP = .   if countryelection == 140
replace voteper_OTHERL_ASP = .    if countryelection == 140

*2009*
replace string_PSparties = "CDU (27.3), CSU (6.5), FDP (14.6), SPD (23), Greens (10.7)" if countryelection == 141
replace string_CPparties = "Indep/Other (1.3, Oth), ODP (0.3, Green)" if countryelection == 141
replace string_SCparties = "NA" if countryelection == 141
replace string_ASparties = "National Democratic Party (1.5, ER), Die Linke (11.9, RL), Republicans (0.4, RR), Pirates (2, Pirat), Human, Environment (0.5, Green)" if countryelection == 141

replace voteper_PSparties = 82.1  if countryelection == 141
replace voteper_CPparties =  1.6 if countryelection == 141
replace voteper_SCparties =  0    if countryelection == 141
replace voteper_ASparties = 16.3 if countryelection == 141

replace voteper_EL_ASP = .    if countryelection == 141
replace voteper_RL_ASP = 11.9       if countryelection == 141
replace voteper_ER_ASP = 1.5        if countryelection == 141
replace voteper_RR_ASP = 0.4      if countryelection == 141
replace voteper_GREEN_ASP = 0.5    if countryelection == 141
replace voteper_PIRATE_ASP = 2     if countryelection == 141
replace voteper_MISC_POP_ASP = .  if countryelection == 141
replace voteper_SEC_NAT_ASP = .   if countryelection == 141
replace voteper_REL_ASP =.       if countryelection == 141
replace voteper_OTHERR_ASP = .   if countryelection == 141
replace voteper_OTHERL_ASP = .    if countryelection == 141

*2013*
replace string_PSparties = "CDU (34.1), CSU (7.4), FDP (4.8), SPD (25.7), Greens (8.4)" if countryelection == 142
replace string_CPparties = "Indep/Other (1.6, Oth), ODP (0.3, Green), Greys (0.4, Pens)" if countryelection == 142
replace string_SCparties = "NA" if countryelection == 142
replace string_ASparties = "National Democratic Party (1.3, ER), Die Linke (8.6, RL), Republicans (0.2, RR), Pirates (2.2, Pirat), AfD (4.7, EUscep), Human Environment (0.3, Greens)" if countryelection == 142

replace voteper_PSparties =  80.4 if countryelection == 142
replace voteper_CPparties =  2.3  if countryelection == 142
replace voteper_SCparties =  0    if countryelection == 142
replace voteper_ASparties =  17.3 if countryelection == 142

replace voteper_EL_ASP = .    if countryelection == 142
replace voteper_RL_ASP = 8.6       if countryelection == 142
replace voteper_ER_ASP = 1.3        if countryelection == 142
replace voteper_RR_ASP = 0.2      if countryelection == 142
replace voteper_GREEN_ASP = 0.3    if countryelection == 142
replace voteper_PIRATE_ASP = 2.2     if countryelection == 142
replace voteper_MISC_POP_ASP = .  if countryelection == 142
replace voteper_SEC_NAT_ASP = .   if countryelection == 142
replace voteper_REL_ASP =.       if countryelection == 142
replace voteper_OTHERR_ASP = .   if countryelection == 142
replace voteper_OTHERL_ASP = .    if countryelection == 142




*********************************************** GREECE ************************************************

***** Source:  Nohlen and Stover (2010) [1974-2007]
*              Ministry of the Interior Website [2009-2015]


*1974*
replace string_PSparties = "New Democracy (54.4), Centre Union (20.4, Lib)" if countryelection == 143
replace string_CPparties = "Other (0.2)" if countryelection == 143
replace string_SCparties = "NA" if countryelection == 143
replace string_ASparties = "PASOK (13.6, RL), EDA (9.5, Com), National Democratic Union (1.1, RW)" if countryelection == 143

replace voteper_PSparties = 74.8  if countryelection == 143
replace voteper_CPparties =  0.9  if countryelection == 143
replace voteper_SCparties =  0    if countryelection == 143
replace voteper_ASparties = 24.2   if countryelection == 143

replace voteper_EL_ASP = 9.5    if countryelection == 143
replace voteper_RL_ASP = 13.6       if countryelection == 143
replace voteper_ER_ASP = 1.1        if countryelection == 143
replace voteper_RR_ASP = .      if countryelection == 143
replace voteper_GREEN_ASP = .    if countryelection == 143
replace voteper_PIRATE_ASP = .     if countryelection == 143
replace voteper_MISC_POP_ASP = .  if countryelection == 143
replace voteper_SEC_NAT_ASP = .   if countryelection == 143
replace voteper_REL_ASP =.       if countryelection == 143
replace voteper_OTHERR_ASP = .   if countryelection == 143
replace voteper_OTHERL_ASP = .   if countryelection == 143

*1977*
replace string_PSparties = "New Democracy (41.8), Centre Union (11.9, Lib), New Liberal Party (1.1, Lib)" if countryelection == 144
replace string_CPparties = "Other (0.7)" if countryelection == 144
replace string_SCparties = "NA" if countryelection == 144
replace string_ASparties = "PASOK (25.3, RL), National Alignment (6.8, RW), KKE (9.4, Com), Rev. Communist (0.2, Com), Progress and Left (2.7, Com)" if countryelection == 144

replace voteper_PSparties = 54.8 if countryelection == 144
replace voteper_CPparties =  0.7  if countryelection == 144
replace voteper_SCparties =  0    if countryelection == 144
replace voteper_ASparties = 44.4 if countryelection == 144

replace voteper_EL_ASP = 12.3    if countryelection == 144
replace voteper_RL_ASP = 25.3       if countryelection == 144
replace voteper_ER_ASP = 6.8        if countryelection == 144
replace voteper_RR_ASP = .      if countryelection == 144
replace voteper_GREEN_ASP = .    if countryelection == 144
replace voteper_PIRATE_ASP = .     if countryelection == 144
replace voteper_MISC_POP_ASP = .  if countryelection == 144
replace voteper_SEC_NAT_ASP = .   if countryelection == 144
replace voteper_REL_ASP =.       if countryelection == 144
replace voteper_OTHERR_ASP = .   if countryelection == 144
replace voteper_OTHERL_ASP = .    if countryelection == 144

*1981*
replace string_PSparties = "New Democracy (35.9), Centre Union (0.4, Lib), Progressive Party (1.7)" if countryelection == 145
replace string_CPparties = "KODISO-KAE (0.7), Other (1.3)" if countryelection == 145
replace string_SCparties = "NA" if countryelection == 145
replace string_ASparties = "PASOK (48.1, LW), KKEs (11.6, Com), Rev. Communist (0.2, Com)" if countryelection == 145

replace voteper_PSparties = 38  if countryelection == 145
replace voteper_CPparties =  2  if countryelection == 145
replace voteper_SCparties =  0    if countryelection == 145
replace voteper_ASparties = 59.9 if countryelection == 145

replace voteper_EL_ASP = 11.8    if countryelection == 145
replace voteper_RL_ASP = 48.1       if countryelection == 145
replace voteper_ER_ASP = .        if countryelection == 145
replace voteper_RR_ASP = .      if countryelection == 145
replace voteper_GREEN_ASP = .    if countryelection == 145
replace voteper_PIRATE_ASP = .     if countryelection == 145
replace voteper_MISC_POP_ASP = .  if countryelection == 145
replace voteper_SEC_NAT_ASP = .   if countryelection == 145
replace voteper_REL_ASP =.       if countryelection == 145
replace voteper_OTHERR_ASP = .   if countryelection == 145
replace voteper_OTHERL_ASP = .   if countryelection == 145

*1985*
replace string_PSparties = "PASOK (45.8, LW), New Democracy (40.8)" if countryelection == 146
replace string_CPparties = "Other (0.7)" if countryelection == 146
replace string_SCparties = "NA" if countryelection == 146
replace string_ASparties = "KKEs (11.7, Com), Rev. Communist (0.3, Com), National Political Union (0.6, ER)" if countryelection == 146

replace voteper_PSparties = 86.6  if countryelection == 146
replace voteper_CPparties =  0.7 if countryelection == 146
replace voteper_SCparties =  0    if countryelection == 146
replace voteper_ASparties = 12.6 if countryelection == 146

replace voteper_EL_ASP = 12    if countryelection == 146
replace voteper_RL_ASP = .       if countryelection == 146
replace voteper_ER_ASP = 0.6        if countryelection == 146
replace voteper_RR_ASP = .      if countryelection == 146
replace voteper_GREEN_ASP = .    if countryelection == 146
replace voteper_PIRATE_ASP = .     if countryelection == 146
replace voteper_MISC_POP_ASP = .  if countryelection == 146
replace voteper_SEC_NAT_ASP = .   if countryelection == 146
replace voteper_REL_ASP =.       if countryelection == 146
replace voteper_OTHERR_ASP = .   if countryelection == 146
replace voteper_OTHERL_ASP = .    if countryelection == 146

*1989a*
replace string_PSparties = "PASOK (39.1, LW), New Democracy (44.3)" if countryelection == 147
replace string_CPparties = "Democratic Renewal (1, Lib), Other (1.8)" if countryelection == 147
replace string_SCparties = "NA" if countryelection == 147
replace string_ASparties = "Left and Progress (13.4, Com), National Political Union (0.3, ER)" if countryelection == 147

replace voteper_PSparties = 83.4  if countryelection == 147
replace voteper_CPparties =  2.8 if countryelection == 147
replace voteper_SCparties =  0    if countryelection == 147
replace voteper_ASparties = 13.7 if countryelection == 147

replace voteper_EL_ASP = 13.4    if countryelection == 147
replace voteper_RL_ASP = .       if countryelection == 147
replace voteper_ER_ASP = 0.3        if countryelection == 147
replace voteper_RR_ASP = .      if countryelection == 147
replace voteper_GREEN_ASP = .    if countryelection == 147
replace voteper_PIRATE_ASP = .     if countryelection == 147
replace voteper_MISC_POP_ASP = .  if countryelection == 147
replace voteper_SEC_NAT_ASP = .   if countryelection == 147
replace voteper_REL_ASP =.       if countryelection == 147
replace voteper_OTHERR_ASP = .   if countryelection == 147
replace voteper_OTHERL_ASP = .    if countryelection == 147

*1989b*
replace string_PSparties = "PASOK (40.7, LW), New Democracy (46.2)" if countryelection == 148
replace string_CPparties = "Other (0.9)" if countryelection == 148
replace string_SCparties = "Left and Progress (11.4, Com)" if countryelection == 148
replace string_ASparties = "Alternative Ecologists (0.6, Green), Left Initiative (0.2, Com)" if countryelection == 148

replace voteper_PSparties = 86.9  if countryelection == 148
replace voteper_CPparties =  0.9 if countryelection == 148
replace voteper_SCparties = 11.4     if countryelection == 148
replace voteper_ASparties =  0.8 if countryelection == 148

replace voteper_EL_ASP = 0.2    if countryelection == 148
replace voteper_RL_ASP = .       if countryelection == 148
replace voteper_ER_ASP = .        if countryelection == 148
replace voteper_RR_ASP = .      if countryelection == 148
replace voteper_GREEN_ASP = 0.6    if countryelection == 148
replace voteper_PIRATE_ASP = .     if countryelection == 148
replace voteper_MISC_POP_ASP = .  if countryelection == 148
replace voteper_SEC_NAT_ASP = .   if countryelection == 148
replace voteper_REL_ASP =.       if countryelection == 148
replace voteper_OTHERR_ASP = .   if countryelection == 148
replace voteper_OTHERL_ASP = .    if countryelection == 148

*1990*
replace string_PSparties = "PASOK (38.6), New Democracy (46.9)" if countryelection == 149
replace string_CPparties = "Democratic Renewal (0.7, Lib), Other (2.8)" if countryelection == 149
replace string_SCparties = "Left and Progress (10.3, Com)" if countryelection == 149
replace string_ASparties = "Alternative Ecologists (0.8, Green)" if countryelection == 149

replace voteper_PSparties = 85.5  if countryelection == 149
replace voteper_CPparties =  3.5  if countryelection == 149
replace voteper_SCparties = 10.3     if countryelection == 149
replace voteper_ASparties =  0.8 if countryelection == 149

replace voteper_EL_ASP = .    if countryelection == 149
replace voteper_RL_ASP = .       if countryelection == 149
replace voteper_ER_ASP = .        if countryelection == 149
replace voteper_RR_ASP = .      if countryelection == 149
replace voteper_GREEN_ASP = 0.8    if countryelection == 149
replace voteper_PIRATE_ASP = .     if countryelection == 149
replace voteper_MISC_POP_ASP = .  if countryelection == 149
replace voteper_SEC_NAT_ASP = .   if countryelection == 149
replace voteper_REL_ASP =.       if countryelection == 149
replace voteper_OTHERR_ASP = .   if countryelection == 149
replace voteper_OTHERL_ASP = .    if countryelection == 149

*1993*
replace string_PSparties = "PASOK (47.1), New Democracy (39.3)" if countryelection == 150
replace string_CPparties = "Political Spring (4.9, Con), Other (0.5, Oth)" if countryelection == 150
replace string_SCparties = "NA" if countryelection == 150
replace string_ASparties = "KKE (4.5, Com), Left and Progress (2.9, RL), National Political Union (0.1, ER), Greek Ecologists (0.2, Green)" if countryelection == 150

replace voteper_PSparties = 86.4  if countryelection == 150
replace voteper_CPparties =  5.9  if countryelection == 150
replace voteper_SCparties =  0   if countryelection == 150
replace voteper_ASparties =  7.7 if countryelection == 150

replace voteper_EL_ASP = 4.5    if countryelection == 150
replace voteper_RL_ASP = 2.9       if countryelection == 150
replace voteper_ER_ASP = 0.1        if countryelection == 150
replace voteper_RR_ASP = .      if countryelection == 150
replace voteper_GREEN_ASP = 0.2    if countryelection == 150
replace voteper_PIRATE_ASP = .     if countryelection == 150
replace voteper_MISC_POP_ASP = .  if countryelection == 150
replace voteper_SEC_NAT_ASP = .   if countryelection == 150
replace voteper_REL_ASP =.       if countryelection == 150
replace voteper_OTHERR_ASP = .   if countryelection == 150
replace voteper_OTHERL_ASP = .    if countryelection == 150

*1996*
replace string_PSparties = "PASOK (41.5), New Democracy (38.1)" if countryelection == 151
replace string_CPparties = "Centre Union (0.7, Lib), Political Spring (2.9, Con), Other (0.8, Oth)" if countryelection == 151
replace string_SCparties = "NA" if countryelection == 151
replace string_ASparties = "DIKKI (4.4, LW), KKE (5.6, Com), Left and Progress (5.1, RL), Rev Com (0.2, Com), Golden Dawn (0.2, ER), National Political Union (0.2, ER), Greek Ecologists (0.4, Green)" if countryelection == 151

replace voteper_PSparties = 79.6  if countryelection == 151
replace voteper_CPparties =  4.4 if countryelection == 151
replace voteper_SCparties =  0    if countryelection == 151
replace voteper_ASparties = 16.1 if countryelection == 151

replace voteper_EL_ASP = 5.8    if countryelection == 151
replace voteper_RL_ASP = 9.5       if countryelection == 151
replace voteper_ER_ASP = 0.4       if countryelection == 151
replace voteper_RR_ASP = .      if countryelection == 151
replace voteper_GREEN_ASP = 0.4    if countryelection == 151
replace voteper_PIRATE_ASP = .     if countryelection == 151
replace voteper_MISC_POP_ASP = .  if countryelection == 151
replace voteper_SEC_NAT_ASP = .   if countryelection == 151
replace voteper_REL_ASP =.       if countryelection == 151
replace voteper_OTHERR_ASP = .   if countryelection == 151
replace voteper_OTHERL_ASP = .    if countryelection == 151

*2000*
replace string_PSparties = "PASOK (43.8), New Democracy (42.7)" if countryelection == 152
replace string_CPparties = "Centre Union (0.3, Lib), Dem Regional Union (0.5, Lib), Other (0.6, Oth)" if countryelection == 152
replace string_SCparties = "NA" if countryelection == 152
replace string_ASparties = "DIKKI (2.7, LW), KKE (5.6, Com), Left and Progress (3.2, RL), Front Line (0.2, ER), Rev Com (0.1, Com), Greek Ecologists (0.3, Green)" if countryelection == 152

replace voteper_PSparties = 86.5  if countryelection == 152
replace voteper_CPparties =  1.4 if countryelection == 152
replace voteper_SCparties =  0    if countryelection == 152
replace voteper_ASparties =  12.1 if countryelection == 152

replace voteper_EL_ASP = 5.7    if countryelection == 152
replace voteper_RL_ASP = 5.9       if countryelection == 152
replace voteper_ER_ASP = 0.2        if countryelection == 152
replace voteper_RR_ASP = .      if countryelection == 152
replace voteper_GREEN_ASP = 0.3    if countryelection == 152
replace voteper_PIRATE_ASP = .     if countryelection == 152
replace voteper_MISC_POP_ASP = .  if countryelection == 152
replace voteper_SEC_NAT_ASP = .   if countryelection == 152
replace voteper_REL_ASP =.       if countryelection == 152
replace voteper_OTHERR_ASP = .   if countryelection == 152
replace voteper_OTHERL_ASP = .    if countryelection == 152

*2004*
replace string_PSparties = "PASOK (40.5), New Democracy (45.4)" if countryelection == 153
replace string_CPparties = "Centre Union (0.3, Lib), Other (0.1, Oth)" if countryelection == 153
replace string_SCparties = "NA" if countryelection == 153
replace string_ASparties = "DIKKI (1.8, LW), KKE (6.1, Com), Left and Progress (3.3, RL), Front Line (0.1, ER), Rev Com (0.2, Com), Popular Orthodox Rally (2.2, RR)" if countryelection == 153

replace voteper_PSparties = 85.9  if countryelection == 153
replace voteper_CPparties = 0.4 if countryelection == 153
replace voteper_SCparties =  0    if countryelection == 153
replace voteper_ASparties = 13.7 if countryelection == 153

replace voteper_EL_ASP = 6.3    if countryelection == 153
replace voteper_RL_ASP = 3.3       if countryelection == 153
replace voteper_ER_ASP = 0.1        if countryelection == 153
replace voteper_RR_ASP = 2.2      if countryelection == 153
replace voteper_GREEN_ASP = .    if countryelection == 153
replace voteper_PIRATE_ASP = .     if countryelection == 153
replace voteper_MISC_POP_ASP = .  if countryelection == 153
replace voteper_SEC_NAT_ASP = .   if countryelection == 153
replace voteper_REL_ASP =.       if countryelection == 153
replace voteper_OTHERR_ASP = .   if countryelection == 153
replace voteper_OTHERL_ASP = .    if countryelection == 153

*2007*
replace string_PSparties = "PASOK (38.1), New Democracy (41.8)" if countryelection == 154
replace string_CPparties = "Centre Union (0.3, Lib), Democratic Revival (0.8, Con), Other (0.2, Oth)" if countryelection == 154
replace string_SCparties = "NA" if countryelection == 154
replace string_ASparties = "KKE (8.2, Com), Left and Progress (5, RL), Ecologists (1.1, Green), Minor Communists (0.7, Com), Popular Orthodox Rally (3.8, RR)" if countryelection == 154

replace voteper_PSparties = 79.9  if countryelection == 154
replace voteper_CPparties =  1.3 if countryelection == 154
replace voteper_SCparties =  0    if countryelection == 154
replace voteper_ASparties = 18.8 if countryelection == 154

replace voteper_EL_ASP = 8.9    if countryelection == 154
replace voteper_RL_ASP = 5       if countryelection == 154
replace voteper_ER_ASP = .        if countryelection == 154
replace voteper_RR_ASP = 3.8      if countryelection == 154
replace voteper_GREEN_ASP = 1.1    if countryelection == 154
replace voteper_PIRATE_ASP = .     if countryelection == 154
replace voteper_MISC_POP_ASP = .  if countryelection == 154
replace voteper_SEC_NAT_ASP = .   if countryelection == 154
replace voteper_REL_ASP =.       if countryelection == 154
replace voteper_OTHERR_ASP = .   if countryelection == 154
replace voteper_OTHERL_ASP = .    if countryelection == 154

*2009*
replace string_PSparties = "PASOK (43.9), New Democracy (33.5)" if countryelection == 155
replace string_CPparties = "Centre Union (0.3, Lib), Democratic Revival (0.5, Con), Other (0.7, Oth)" if countryelection == 155
replace string_SCparties = "NA" if countryelection == 155
replace string_ASparties = "KKE (7.5, Com), Left and Progress (4.6, RL), Ecologists (2.5, Green), Anti-Cap Left (0.4, Com), Minor Extr Left (0.3, EL), Golden Dawn (0.3, ER), Popular Orthodox Rally (5.6, RR)" if countryelection == 155

replace voteper_PSparties = 77.4  if countryelection == 155
replace voteper_CPparties =  1.5 if countryelection == 155
replace voteper_SCparties =  0    if countryelection == 155
replace voteper_ASparties = 21.2 if countryelection == 155

replace voteper_EL_ASP = 8.2    if countryelection == 155
replace voteper_RL_ASP = 4.6       if countryelection == 155
replace voteper_ER_ASP = 0.3        if countryelection == 155
replace voteper_RR_ASP = 5.6      if countryelection == 155
replace voteper_GREEN_ASP = 2.5    if countryelection == 155
replace voteper_PIRATE_ASP = .     if countryelection == 155
replace voteper_MISC_POP_ASP = .  if countryelection == 155
replace voteper_SEC_NAT_ASP = .   if countryelection == 155
replace voteper_REL_ASP =.       if countryelection == 155
replace voteper_OTHERR_ASP = .   if countryelection == 155
replace voteper_OTHERL_ASP = .    if countryelection == 155

*2012a*
replace string_PSparties = "PASOK (13.2), New Democracy (18.9)" if countryelection == 156
replace string_CPparties = "Democratic Alliance (2.6, RW), Recreate Greece (2.2, Lib), Centre Union (0.6, Lib), Social Agreement (1, LW), Democratic Left (6.1, LW), Other (2.9, Oth)" if countryelection == 156
replace string_SCparties = "Popular Orthodox Rally (2.9, RR)" if countryelection == 156
replace string_ASparties = "Independent Greeks (10.6, RR), Liberal Alliance (1.5, OR), I Don't Pay (0.9, RL), KKE (8.5, Com), SYRIZA (16.8, RL), Ecologists (2.9, Green), Anti-Cap Left (1.6, Com), Golden Dawn (7, ER)" if countryelection == 156

replace voteper_PSparties = 32.1  if countryelection == 156
replace voteper_CPparties = 15.2  if countryelection == 156
replace voteper_SCparties =  2.9    if countryelection == 156
replace voteper_ASparties = 49.8 if countryelection == 156

replace voteper_EL_ASP = 10.1    if countryelection == 156
replace voteper_RL_ASP = 17.7       if countryelection == 156
replace voteper_ER_ASP = 7        if countryelection == 156
replace voteper_RR_ASP = 10.6      if countryelection == 156
replace voteper_GREEN_ASP = 2.9    if countryelection == 156
replace voteper_PIRATE_ASP = .     if countryelection == 156
replace voteper_MISC_POP_ASP = .  if countryelection == 156
replace voteper_SEC_NAT_ASP = .   if countryelection == 156
replace voteper_REL_ASP =.       if countryelection == 156
replace voteper_OTHERR_ASP = 1.5   if countryelection == 156
replace voteper_OTHERL_ASP = .    if countryelection == 156

*2012b*
replace string_PSparties = "PASOK (12.3), New Democracy (29.7)" if countryelection == 157
replace string_CPparties = "Democratic Left (6.3, LW), Other (0.9, Oth)" if countryelection == 157
replace string_SCparties = "Popular Orthodox Rally (1.6, RR)" if countryelection == 157
replace string_ASparties = "Independent Greeks (7.5, RR), Liberal Alliance/Recreate Greece (1.6, OR), I Don't Pay (0.4, RL), KKE (4.5, Com), SYRIZA (26.9, RL), Ecologists (0.9, Green), Anti-Cap Left (0.3, Com), Golden Dawn (6.9, ER), Pirate Party (0.2, Pirat)" if countryelection == 157

replace voteper_PSparties =  42  if countryelection == 157
replace voteper_CPparties =  7.2 if countryelection == 157
replace voteper_SCparties =  1.6   if countryelection == 157
replace voteper_ASparties = 49.2 if countryelection == 157

replace voteper_EL_ASP = 4.8    if countryelection == 157
replace voteper_RL_ASP = 27.3       if countryelection == 157
replace voteper_ER_ASP = 6.9        if countryelection == 157
replace voteper_RR_ASP = 7.5      if countryelection == 157
replace voteper_GREEN_ASP = 0.9    if countryelection == 157
replace voteper_PIRATE_ASP = 0.2     if countryelection == 157
replace voteper_MISC_POP_ASP = .  if countryelection == 157
replace voteper_SEC_NAT_ASP = .   if countryelection == 157
replace voteper_REL_ASP =.       if countryelection == 157
replace voteper_OTHERR_ASP = 1.6   if countryelection == 157
replace voteper_OTHERL_ASP = .    if countryelection == 157

*2015a*
replace string_PSparties = "PASOK (4.7), New Democracy (27.8), Democratic Left (0.3, LW)" if countryelection == 158
replace string_CPparties = "Centre Union (1.8, Lib), Stop (1.8, Other), The River (6.1, LW), Other (0.4, Oth), Movement of Dem Socialists (2.5, LW)" if countryelection == 158
replace string_SCparties = "Popular Orthodox Rally (1, RR)" if countryelection == 158
replace string_ASparties = "Independent Greeks (4.8, RR), KKE (5.5, Com), SYRIZA (36.3, RL), Ecologists (0.2, Green), Anti-Cap Left (0.7, Com), Golden Dawn (6.3, ER)" if countryelection == 158

replace voteper_PSparties = 32.8  if countryelection == 158
replace voteper_CPparties = 12.4  if countryelection == 158
replace voteper_SCparties =  1    if countryelection == 158
replace voteper_ASparties = 53.8 if countryelection == 158

replace voteper_EL_ASP = 6.2    if countryelection == 158
replace voteper_RL_ASP = 36.3       if countryelection == 158
replace voteper_ER_ASP = 6.3        if countryelection == 158
replace voteper_RR_ASP = 4.8      if countryelection == 158
replace voteper_GREEN_ASP = 0.2    if countryelection == 158
replace voteper_PIRATE_ASP = .     if countryelection == 158
replace voteper_MISC_POP_ASP = .  if countryelection == 158
replace voteper_SEC_NAT_ASP = .   if countryelection == 158
replace voteper_REL_ASP =.       if countryelection == 158
replace voteper_OTHERR_ASP = .   if countryelection == 158
replace voteper_OTHERL_ASP = .    if countryelection == 158

*2015b*
replace string_PSparties = "PASOK (6.3), New Democracy (28.1)" if countryelection == 159
replace string_CPparties = "Centre Union (3.4, Lib), The River (4.1, LW), Recreate Greece (0.5)" if countryelection == 159
replace string_SCparties = "SYRIZA (35), Independent Greeks (RR, 3.7), Ecologist Greens (0.5, Green)" if countryelection == 159
replace string_ASparties = "Popular Unity (2.9, RL), United Popular Front (0.8, MISC_POP), KKE (5.6, Com), Other ML (0.2,EL)  Anti-Cap Left (0.9, Com), Pirate Party (0.3), Golden Dawn (7, ER) Society (0.7)" if countryelection == 159

replace voteper_PSparties = 34.4 if countryelection == 159
replace voteper_CPparties =  8.0 if countryelection == 159
replace voteper_SCparties = 39.2 if countryelection == 159
replace voteper_ASparties = 18.4 if countryelection == 159

replace voteper_EL_ASP = 6.7    if countryelection == 159
replace voteper_RL_ASP = 2.9       if countryelection == 159
replace voteper_ER_ASP = 7        if countryelection == 159
replace voteper_RR_ASP = .      if countryelection == 159
replace voteper_GREEN_ASP = .    if countryelection == 159
replace voteper_PIRATE_ASP = 0.3     if countryelection == 159
replace voteper_MISC_POP_ASP = 0.8  if countryelection == 159
replace voteper_SEC_NAT_ASP = .   if countryelection == 159
replace voteper_REL_ASP =.       if countryelection == 159
replace voteper_OTHERR_ASP = 0.7   if countryelection == 159
replace voteper_OTHERL_ASP = .    if countryelection == 159



************************************************** ICELAND *********************************************

***** Source:  Nohlen and Stover (2010) [1953-2007]
*              Alvarez-Rivera database [2009-2016]



*1953*
replace string_PSparties = "Independence Party (37.1), Progressive Party (21.9), SDP (15.6)" if countryelection == 160
replace string_CPparties = "National Preservation Party (6), Republican Party (3.3)" if countryelection == 160
replace string_SCparties = "Socialist Party - People's Unity (16)" if countryelection == 160
replace string_ASparties = "NA" if countryelection == 160

replace voteper_PSparties = 74.6  if countryelection == 160
replace voteper_CPparties =  9.3 if countryelection == 160
replace voteper_SCparties = 16   if countryelection == 160
replace voteper_ASparties =  0 if countryelection == 160

replace voteper_EL_ASP = .    if countryelection == 160
replace voteper_RL_ASP = .       if countryelection == 160
replace voteper_ER_ASP = .        if countryelection == 160
replace voteper_RR_ASP = .      if countryelection == 160
replace voteper_GREEN_ASP = .    if countryelection == 160
replace voteper_PIRATE_ASP = .     if countryelection == 160
replace voteper_MISC_POP_ASP = .  if countryelection == 160
replace voteper_SEC_NAT_ASP = .   if countryelection == 160
replace voteper_REL_ASP =.       if countryelection == 160
replace voteper_OTHERR_ASP = .   if countryelection == 160
replace voteper_OTHERL_ASP = .    if countryelection == 160

*1956*
replace string_PSparties = "Independence Party (42.4), Progressive Party (15.6), SDP (18.3)" if countryelection == 161
replace string_CPparties = "National Preservation Party (4.5)" if countryelection == 161
replace string_SCparties = "Socialist Party - People's Unity (19.2)" if countryelection == 161
replace string_ASparties = "NA" if countryelection == 161

replace voteper_PSparties = 76.3  if countryelection == 161
replace voteper_CPparties =  4.5 if countryelection == 161
replace voteper_SCparties = 19.2    if countryelection == 161
replace voteper_ASparties =  0   if countryelection == 161

replace voteper_EL_ASP = .    if countryelection == 161
replace voteper_RL_ASP = .       if countryelection == 161
replace voteper_ER_ASP = .        if countryelection == 161
replace voteper_RR_ASP = .      if countryelection == 161
replace voteper_GREEN_ASP = .    if countryelection == 161
replace voteper_PIRATE_ASP = .     if countryelection == 161
replace voteper_MISC_POP_ASP = .  if countryelection == 161
replace voteper_SEC_NAT_ASP = .   if countryelection == 161
replace voteper_REL_ASP =.       if countryelection == 161
replace voteper_OTHERR_ASP = .   if countryelection == 161
replace voteper_OTHERL_ASP = .    if countryelection == 161

*1959a*
replace string_PSparties = "Independence Party (42.5), Progressive Party (27.2), SDP (12.5)" if countryelection == 162
replace string_CPparties = "National Preservation Party (2.5)" if countryelection == 162
replace string_SCparties = "Socialist Party - People's Unity (15.2)" if countryelection == 162
replace string_ASparties = "NA" if countryelection == 162

replace voteper_PSparties = 82.2   if countryelection == 162
replace voteper_CPparties =  2.5 if countryelection == 162
replace voteper_SCparties = 15.2   if countryelection == 162
replace voteper_ASparties =  0  if countryelection == 162

replace voteper_EL_ASP = .    if countryelection == 162
replace voteper_RL_ASP = .       if countryelection == 162
replace voteper_ER_ASP = .        if countryelection == 162
replace voteper_RR_ASP = .      if countryelection == 162
replace voteper_GREEN_ASP = .    if countryelection == 162
replace voteper_PIRATE_ASP = .     if countryelection == 162
replace voteper_MISC_POP_ASP = .  if countryelection == 162
replace voteper_SEC_NAT_ASP = .   if countryelection == 162
replace voteper_REL_ASP =.       if countryelection == 162
replace voteper_OTHERR_ASP = .   if countryelection == 162
replace voteper_OTHERL_ASP = .    if countryelection == 162

*1959b*
replace string_PSparties = "Independence Party (39.7), Progressive Party (25.7), SDP (15.2)" if countryelection == 163
replace string_CPparties = "National Preservation Party (3.4)" if countryelection == 163
replace string_SCparties = "Socialist Party - People's Unity (16)" if countryelection == 163
replace string_ASparties = "NA" if countryelection == 163

replace voteper_PSparties = 80.6  if countryelection == 163
replace voteper_CPparties =  3.4 if countryelection == 163
replace voteper_SCparties = 16    if countryelection == 163
replace voteper_ASparties =  0  if countryelection == 163

replace voteper_EL_ASP = .    if countryelection == 163
replace voteper_RL_ASP = .       if countryelection == 163
replace voteper_ER_ASP = .        if countryelection == 163
replace voteper_RR_ASP = .      if countryelection == 163
replace voteper_GREEN_ASP = .    if countryelection == 163
replace voteper_PIRATE_ASP = .     if countryelection == 163
replace voteper_MISC_POP_ASP = .  if countryelection == 163
replace voteper_SEC_NAT_ASP = .   if countryelection == 163
replace voteper_REL_ASP =.       if countryelection == 163
replace voteper_OTHERR_ASP = .   if countryelection == 163
replace voteper_OTHERL_ASP = .    if countryelection == 163

*1963*
replace string_PSparties = "Independence Party (41.4), Progressive Party (28.2), SDP (14.2)" if countryelection == 164
replace string_CPparties = "Indep-Other (0.2)" if countryelection == 164
replace string_SCparties = "Socialist Party - People's Unity (16)" if countryelection == 164
replace string_ASparties = "NA" if countryelection == 164

replace voteper_PSparties = 83.8  if countryelection == 164
replace voteper_CPparties =  0.2 if countryelection == 164
replace voteper_SCparties = 16    if countryelection == 164
replace voteper_ASparties =  0  if countryelection == 164

replace voteper_EL_ASP = .    if countryelection == 164
replace voteper_RL_ASP = .       if countryelection == 164
replace voteper_ER_ASP = .        if countryelection == 164
replace voteper_RR_ASP = .      if countryelection == 164
replace voteper_GREEN_ASP = .    if countryelection == 164
replace voteper_PIRATE_ASP = .     if countryelection == 164
replace voteper_MISC_POP_ASP = .  if countryelection == 164
replace voteper_SEC_NAT_ASP = .   if countryelection == 164
replace voteper_REL_ASP =.       if countryelection == 164
replace voteper_OTHERR_ASP = .   if countryelection == 164
replace voteper_OTHERL_ASP = .    if countryelection == 164

*1967*
replace string_PSparties = "Independence Party (37.5), Progressive Party (28.1), SDP (15.7)" if countryelection == 165
replace string_CPparties = "Indep-Other (1.1)" if countryelection == 165
replace string_SCparties = "Socialist Party - People's Unity (17.6)" if countryelection == 165
replace string_ASparties = "NA" if countryelection == 165

replace voteper_PSparties = 81.3  if countryelection == 165
replace voteper_CPparties =  1.1 if countryelection == 165
replace voteper_SCparties = 17.6    if countryelection == 165
replace voteper_ASparties =  0  if countryelection == 165

replace voteper_EL_ASP = .    if countryelection == 165
replace voteper_RL_ASP = .       if countryelection == 165
replace voteper_ER_ASP = .        if countryelection == 165
replace voteper_RR_ASP = .      if countryelection == 165
replace voteper_GREEN_ASP = .    if countryelection == 165
replace voteper_PIRATE_ASP = .     if countryelection == 165
replace voteper_MISC_POP_ASP = .  if countryelection == 165
replace voteper_SEC_NAT_ASP = .   if countryelection == 165
replace voteper_REL_ASP =.       if countryelection == 165
replace voteper_OTHERR_ASP = .   if countryelection == 165
replace voteper_OTHERL_ASP = .    if countryelection == 165

*1971*
replace string_PSparties = "Independence Party (36.2), Progressive Party (25.3), SDP (10.5)" if countryelection == 166
replace string_CPparties = "Union of Liberals and Leftists (8.9, LW)" if countryelection == 166
replace string_SCparties = "Socialist Party - People's Unity (17.1)" if countryelection == 166
replace string_ASparties = "Candidature Party (2, MISC_POP)" if countryelection == 166

replace voteper_PSparties = 72  if countryelection == 166
replace voteper_CPparties =  8.9 if countryelection == 166
replace voteper_SCparties = 17.1    if countryelection == 166
replace voteper_ASparties =  2 if countryelection == 166

replace voteper_EL_ASP = .    if countryelection == 166
replace voteper_RL_ASP = .       if countryelection == 166
replace voteper_ER_ASP = .        if countryelection == 166
replace voteper_RR_ASP = .      if countryelection == 166
replace voteper_GREEN_ASP = .    if countryelection == 166
replace voteper_PIRATE_ASP = .     if countryelection == 166
replace voteper_MISC_POP_ASP = 2  if countryelection == 166
replace voteper_SEC_NAT_ASP = .   if countryelection == 166
replace voteper_REL_ASP =.       if countryelection == 166
replace voteper_OTHERR_ASP = .   if countryelection == 166
replace voteper_OTHERL_ASP = .    if countryelection == 166

*1974*
replace string_PSparties = "Independence Party (42.7), Progressive Party (24.9), SDP (9.1), Union of Liberals and Leftists (4.6)" if countryelection == 167
replace string_CPparties = "Independence-Other (0.2)" if countryelection == 167
replace string_SCparties = "Socialist Party - People's Unity (18.3)" if countryelection == 167
replace string_ASparties = "Rev. Com (0.2, Com)" if countryelection == 167

replace voteper_PSparties =  81.3 if countryelection == 167
replace voteper_CPparties =  0.2 if countryelection == 167
replace voteper_SCparties = 18.3    if countryelection == 167
replace voteper_ASparties =  0.2 if countryelection == 167

replace voteper_EL_ASP = 0.2    if countryelection == 167
replace voteper_RL_ASP = .       if countryelection == 167
replace voteper_ER_ASP = .        if countryelection == 167
replace voteper_RR_ASP = .      if countryelection == 167
replace voteper_GREEN_ASP = .    if countryelection == 167
replace voteper_PIRATE_ASP = .     if countryelection == 167
replace voteper_MISC_POP_ASP = .  if countryelection == 167
replace voteper_SEC_NAT_ASP = .   if countryelection == 167
replace voteper_REL_ASP =.       if countryelection == 167
replace voteper_OTHERR_ASP = .   if countryelection == 167
replace voteper_OTHERL_ASP = .    if countryelection == 167

*1978*
replace string_PSparties = "Independence Party (32.7), Progressive Party (16.9), SDP (22), Union of Liberals and Leftists (3.3)" if countryelection == 168
replace string_CPparties = "Independence-Other (1.8)" if countryelection == 168
replace string_SCparties = "Socialist Party - People's Unity (22.9)" if countryelection == 168
replace string_ASparties = "Rev. Com (0.3, Com)" if countryelection == 168

replace voteper_PSparties = 74.9 if countryelection == 168
replace voteper_CPparties =  1.8 if countryelection == 168
replace voteper_SCparties = 22.9   if countryelection == 168
replace voteper_ASparties =  0.3 if countryelection == 168

replace voteper_EL_ASP = 0.3    if countryelection == 168
replace voteper_RL_ASP = .       if countryelection == 168
replace voteper_ER_ASP = .        if countryelection == 168
replace voteper_RR_ASP = .      if countryelection == 168
replace voteper_GREEN_ASP = .    if countryelection == 168
replace voteper_PIRATE_ASP = .     if countryelection == 168
replace voteper_MISC_POP_ASP = .  if countryelection == 168
replace voteper_SEC_NAT_ASP = .   if countryelection == 168
replace voteper_REL_ASP =.       if countryelection == 168
replace voteper_OTHERR_ASP = .   if countryelection == 168
replace voteper_OTHERL_ASP = .    if countryelection == 168

*1979*
replace string_PSparties = "Independence Party (35.4), Progressive Party (24.9), SDP (17.4)" if countryelection == 169
replace string_CPparties = "Independence-Other (2.1)" if countryelection == 169
replace string_SCparties = "Socialist Party - People's Unity (19.7)" if countryelection == 169
replace string_ASparties = "Rev. Com (0.4, Com)" if countryelection == 169

replace voteper_PSparties = 77.7  if countryelection == 169
replace voteper_CPparties =  2.1 if countryelection == 169
replace voteper_SCparties = 19.7   if countryelection == 169
replace voteper_ASparties =  0.4 if countryelection == 169

replace voteper_EL_ASP = 0.4    if countryelection == 169
replace voteper_RL_ASP = .       if countryelection == 169
replace voteper_ER_ASP = .        if countryelection == 169
replace voteper_RR_ASP = .      if countryelection == 169
replace voteper_GREEN_ASP = .    if countryelection == 169
replace voteper_PIRATE_ASP = .     if countryelection == 169
replace voteper_MISC_POP_ASP = .  if countryelection == 169
replace voteper_SEC_NAT_ASP = .   if countryelection == 169
replace voteper_REL_ASP =.       if countryelection == 169
replace voteper_OTHERR_ASP = .   if countryelection == 169
replace voteper_OTHERL_ASP = .    if countryelection == 169

*1983*
replace string_PSparties = "Independence Party (38.7), Progressive Party (19), SDP (11.7)" if countryelection == 170
replace string_CPparties = "Independence-Other (0.5), Alliance of Soc Dem (7.3)" if countryelection == 170
replace string_SCparties = "Socialist Party - People's Unity (17.3)" if countryelection == 170
replace string_ASparties = "Women's Party (5.5, OL)" if countryelection == 170

replace voteper_PSparties = 69.4 if countryelection == 170
replace voteper_CPparties =  7.8 if countryelection == 170
replace voteper_SCparties = 17.3    if countryelection == 170
replace voteper_ASparties =  5.5 if countryelection == 170

replace voteper_EL_ASP = .    if countryelection == 170
replace voteper_RL_ASP = .       if countryelection == 170
replace voteper_ER_ASP = .        if countryelection == 170
replace voteper_RR_ASP = .      if countryelection == 170
replace voteper_GREEN_ASP = .    if countryelection == 170
replace voteper_PIRATE_ASP = .     if countryelection == 170
replace voteper_MISC_POP_ASP = .  if countryelection == 170
replace voteper_SEC_NAT_ASP = .   if countryelection == 170
replace voteper_REL_ASP =.       if countryelection == 170
replace voteper_OTHERR_ASP = .   if countryelection == 170
replace voteper_OTHERL_ASP = 5.5    if countryelection == 170

*1987*
replace string_PSparties = "Independence Party (27.3), Progressive Party (18.9), SDP (15.2)" if countryelection == 171
replace string_CPparties = "Humanist (1.3, Oth), National Party (1.3, Oth), Assoc. for Social Justice (1.3, LW), Alliance of Soc Dem (0.2)" if countryelection == 171
replace string_SCparties = "Socialist Party - People's Unity (13.4)" if countryelection == 171
replace string_ASparties = "Women's Party (10.1, OL), Citizens Party (10.9 ,RR)" if countryelection == 171

replace voteper_PSparties = 61.4  if countryelection == 171
replace voteper_CPparties =  4.1 if countryelection == 171
replace voteper_SCparties = 13.4    if countryelection == 171
replace voteper_ASparties =  21  if countryelection == 171

replace voteper_EL_ASP = .    if countryelection == 171
replace voteper_RL_ASP = .       if countryelection == 171
replace voteper_ER_ASP = .        if countryelection == 171
replace voteper_RR_ASP = 10.9      if countryelection == 171
replace voteper_GREEN_ASP = .    if countryelection == 171
replace voteper_PIRATE_ASP = .     if countryelection == 171
replace voteper_MISC_POP_ASP = .  if countryelection == 171
replace voteper_SEC_NAT_ASP = .   if countryelection == 171
replace voteper_REL_ASP =.       if countryelection == 171
replace voteper_OTHERR_ASP = .   if countryelection == 171
replace voteper_OTHERL_ASP = 10.1    if countryelection == 171

*1991*
replace string_PSparties = "Independence Party (38.6), Progressive Party (18.9), SDP (15.5)" if countryelection == 172
replace string_CPparties = "Liberal (1.2, Lib), Home Rule Assoc (0.6, Oth), National Party (1.8)" if countryelection == 172
replace string_SCparties = "Socialist Party - People's Unity (14.4)" if countryelection == 172
replace string_ASparties = "Women's Party (8.3, OL), Rev.Com (0.3, Com)" if countryelection == 172

replace voteper_PSparties = 73  if countryelection == 172
replace voteper_CPparties =  4 if countryelection == 172
replace voteper_SCparties = 14.4    if countryelection == 172
replace voteper_ASparties =  8.6 if countryelection == 172

replace voteper_EL_ASP = 0.3    if countryelection == 172
replace voteper_RL_ASP = .       if countryelection == 172
replace voteper_ER_ASP = .        if countryelection == 172
replace voteper_RR_ASP = .      if countryelection == 172
replace voteper_GREEN_ASP = .    if countryelection == 172
replace voteper_PIRATE_ASP = .     if countryelection == 172
replace voteper_MISC_POP_ASP = .  if countryelection == 172
replace voteper_SEC_NAT_ASP = .   if countryelection == 172
replace voteper_REL_ASP =.       if countryelection == 172
replace voteper_OTHERR_ASP = .   if countryelection == 172
replace voteper_OTHERL_ASP = 8.3    if countryelection == 172

*1995*
replace string_PSparties = "Independence Party (37.1), Progressive Party (23.3), SDP (11.4)" if countryelection == 173
replace string_CPparties = "National Awakening (7.2, LW), South List (0.7, Oth), Othher (0.6, Oth)" if countryelection == 173
replace string_SCparties = "Socialist Party - People's Unity (14.3)" if countryelection == 173
replace string_ASparties = "Women's Party (4.9, Fem), Natural Law Party (0.6, Rel)" if countryelection == 173

replace voteper_PSparties = 71.8  if countryelection == 173
replace voteper_CPparties =  8.5 if countryelection == 173
replace voteper_SCparties = 14.3   if countryelection == 173
replace voteper_ASparties =  5.5 if countryelection == 173

replace voteper_EL_ASP = .    if countryelection == 173
replace voteper_RL_ASP = .       if countryelection == 173
replace voteper_ER_ASP = .        if countryelection == 173
replace voteper_RR_ASP = .      if countryelection == 173
replace voteper_GREEN_ASP = .    if countryelection == 173
replace voteper_PIRATE_ASP = .     if countryelection == 173
replace voteper_MISC_POP_ASP = .  if countryelection == 173
replace voteper_SEC_NAT_ASP = .   if countryelection == 173
replace voteper_REL_ASP = 0.6       if countryelection == 173
replace voteper_OTHERR_ASP = .   if countryelection == 173
replace voteper_OTHERL_ASP = 4.9    if countryelection == 173

*1999*
replace string_PSparties = "Independence Party (40.7), Progressive Party (18.4), SDP (26.8)" if countryelection == 174
replace string_CPparties = "Liberal Party (4.2, Lib), Other (0.7, Oth)" if countryelection == 174
replace string_SCparties = "NA" if countryelection == 174
replace string_ASparties = "Left-Green Movement (9.1, RL), Anarchists (0.1, RL)" if countryelection == 174

replace voteper_PSparties = 85.9  if countryelection == 174
replace voteper_CPparties =  4.9 if countryelection == 174
replace voteper_SCparties =  0  if countryelection == 174
replace voteper_ASparties =  9.2 if countryelection == 174

replace voteper_EL_ASP = .    if countryelection == 174
replace voteper_RL_ASP = 9.2       if countryelection == 174
replace voteper_ER_ASP = .        if countryelection == 174
replace voteper_RR_ASP = .      if countryelection == 174
replace voteper_GREEN_ASP = .    if countryelection == 174
replace voteper_PIRATE_ASP = .     if countryelection == 174
replace voteper_MISC_POP_ASP = .  if countryelection == 174
replace voteper_SEC_NAT_ASP = .   if countryelection == 174
replace voteper_REL_ASP =.       if countryelection == 174
replace voteper_OTHERR_ASP = .   if countryelection == 174
replace voteper_OTHERL_ASP = .    if countryelection == 174

*2003*
replace string_PSparties = "Independence Party (33.7), Progressive Party (17.7), SDP (31)" if countryelection == 175
replace string_CPparties = "Liberal Party (7.4, Lib), Other (0.5, Oth)" if countryelection == 175
replace string_SCparties = "NA" if countryelection == 175
replace string_ASparties = "Left-Green Movement (8.8, RL), New Force (1, RR)" if countryelection == 175

replace voteper_PSparties = 82.4  if countryelection == 175
replace voteper_CPparties =  7.9 if countryelection == 175
replace voteper_SCparties =  0  if countryelection == 175
replace voteper_ASparties =  9.8 if countryelection == 175

replace voteper_EL_ASP = .    if countryelection == 175
replace voteper_RL_ASP = 8.8       if countryelection == 175
replace voteper_ER_ASP = .        if countryelection == 175
replace voteper_RR_ASP = 1      if countryelection == 175
replace voteper_GREEN_ASP = .    if countryelection == 175
replace voteper_PIRATE_ASP = .     if countryelection == 175
replace voteper_MISC_POP_ASP = .  if countryelection == 175
replace voteper_SEC_NAT_ASP = .   if countryelection == 175
replace voteper_REL_ASP =.       if countryelection == 175
replace voteper_OTHERR_ASP = .   if countryelection == 175
replace voteper_OTHERL_ASP = .    if countryelection == 175

*2007*
replace string_PSparties = "Independence Party (36.6), Progressive Party (11.7), SDP (26.8)" if countryelection == 176
replace string_CPparties = "Living Country (3.3, Green)" if countryelection == 176
replace string_SCparties = "NA" if countryelection == 176
replace string_ASparties = "Liberal Party (7.3, RR), Left-Green Movement (14.3, RL)" if countryelection == 176

replace voteper_PSparties = 75.1  if countryelection == 176
replace voteper_CPparties =  3.3 if countryelection == 176
replace voteper_SCparties =  0   if countryelection == 176
replace voteper_ASparties =  21.6 if countryelection == 176

replace voteper_EL_ASP = .    if countryelection == 176
replace voteper_RL_ASP = 14.3       if countryelection == 176
replace voteper_ER_ASP = .        if countryelection == 176
replace voteper_RR_ASP = 7.3      if countryelection == 176
replace voteper_GREEN_ASP = .    if countryelection == 176
replace voteper_PIRATE_ASP = .     if countryelection == 176
replace voteper_MISC_POP_ASP = .  if countryelection == 176
replace voteper_SEC_NAT_ASP = .   if countryelection == 176
replace voteper_REL_ASP =.       if countryelection == 176
replace voteper_OTHERR_ASP = .   if countryelection == 176
replace voteper_OTHERL_ASP = .    if countryelection == 176

*2009*
replace string_PSparties = "Independence Party (23.7), Progressive Party (14.8), SDP (29.8)" if countryelection == 177
replace string_CPparties = "NA" if countryelection == 177
replace string_SCparties = "NA" if countryelection == 177
replace string_ASparties = "Civic Movement (7.2, MISC_POP), Liberal Party (2.2, RR), Democracy Movement (0.6, MISC_POP), Left-Green Movement (21.7, RL)" if countryelection == 177

replace voteper_PSparties = 68.3  if countryelection == 177
replace voteper_CPparties =  0   if countryelection == 177
replace voteper_SCparties =  0   if countryelection == 177
replace voteper_ASparties = 31.7 if countryelection == 177

replace voteper_EL_ASP = .    if countryelection == 177
replace voteper_RL_ASP = 21.7       if countryelection == 177
replace voteper_ER_ASP = .        if countryelection == 177
replace voteper_RR_ASP = 2.2      if countryelection == 177
replace voteper_GREEN_ASP = .    if countryelection == 177
replace voteper_PIRATE_ASP = .     if countryelection == 177
replace voteper_MISC_POP_ASP = 7.8  if countryelection == 177
replace voteper_SEC_NAT_ASP = .   if countryelection == 177
replace voteper_REL_ASP =.       if countryelection == 177
replace voteper_OTHERR_ASP = .   if countryelection == 177
replace voteper_OTHERL_ASP = .    if countryelection == 177

*2013*
replace string_PSparties = "Independence Party (26.7), Progressive Party (24.4), SDP (12.9)" if countryelection == 178
replace string_CPparties = "Household Party (3, LW), Right-Green People's (1.7, Con), Other (0.4)" if countryelection == 178
replace string_SCparties = "Left-Green Movement (10.9, RL)" if countryelection == 178
replace string_ASparties = "Rainbow (1.1, RL), Bright Future (8.2, OL), Dawn (3.1, MISC_POP), Pirate Party (5.1, Pir), Democratic Party (2.5, MISC_POP)" if countryelection == 178

replace voteper_PSparties = 64  if countryelection == 178
replace voteper_CPparties =  5.1 if countryelection == 178
replace voteper_SCparties = 10.9    if countryelection == 178
replace voteper_ASparties = 20.0 if countryelection == 178

replace voteper_EL_ASP = .    if countryelection == 178
replace voteper_RL_ASP = 1.1       if countryelection == 178
replace voteper_ER_ASP = .        if countryelection == 178
replace voteper_RR_ASP = .      if countryelection == 178
replace voteper_GREEN_ASP = .    if countryelection == 178
replace voteper_PIRATE_ASP = 5.1     if countryelection == 178
replace voteper_MISC_POP_ASP = 5.6  if countryelection == 178
replace voteper_SEC_NAT_ASP = .   if countryelection == 178
replace voteper_REL_ASP =.       if countryelection == 178
replace voteper_OTHERR_ASP = .   if countryelection == 178
replace voteper_OTHERL_ASP = 8.2    if countryelection == 178

*2016*
replace string_PSparties = "Independence Party (29), Progressive Party (11.5), SDP (5.7)" if countryelection == 179
replace string_CPparties = "Reform Party (10.5, Lib)" if countryelection == 179
replace string_SCparties = "Left-Green Movement (15.9, RL)" if countryelection == 179
replace string_ASparties = "People's Party (3.5, MISC_POP), People's Front (0.3, Com), Bright Future (7.2, OL), Dawn (1.7, MISC_POP), Pirate Party (14.5, Pir), National Front (0.2, RR)" if countryelection == 179

replace voteper_PSparties = 46.2  if countryelection == 179
replace voteper_CPparties = 10.5 if countryelection == 179
replace voteper_SCparties = 15.9    if countryelection == 179
replace voteper_ASparties = 27.4 if countryelection == 179

replace voteper_EL_ASP = 0.3    if countryelection == 179
replace voteper_RL_ASP = .       if countryelection == 179
replace voteper_ER_ASP = .        if countryelection == 179
replace voteper_RR_ASP = 0.2      if countryelection == 179
replace voteper_GREEN_ASP = .    if countryelection == 179
replace voteper_PIRATE_ASP = 14.5     if countryelection == 179
replace voteper_MISC_POP_ASP = 5.2  if countryelection == 179
replace voteper_SEC_NAT_ASP = .   if countryelection == 179
replace voteper_REL_ASP =.       if countryelection == 179
replace voteper_OTHERR_ASP = .   if countryelection == 179
replace voteper_OTHERL_ASP = 7.2    if countryelection == 179



***************************************************** IRELAND *******************************************************

***** Source:  Nohlen and Stover (2010) [1951-2007]
*              Irish Times [2011-2016]


*1951*
replace string_PSparties = "Fianna Fail (46.3), Fine Gael (25.8), Labour (11.4)" if countryelection == 180
replace string_CPparties = "Indep/Other (9.6, Oth)" if countryelection == 180
replace string_SCparties = "Clann na Talmhan (2.9, Rural.Pop), Clann na Poblechta (4.1, Nat)" if countryelection == 180
replace string_ASparties = "NA" if countryelection == 180

replace voteper_PSparties = 83.5 if countryelection == 180
replace voteper_CPparties =  9.6 if countryelection == 180
replace voteper_SCparties =  7.0   if countryelection == 180
replace voteper_ASparties =  0  if countryelection == 180

replace voteper_EL_ASP = .    if countryelection == 180
replace voteper_RL_ASP = .       if countryelection == 180
replace voteper_ER_ASP = .        if countryelection == 180
replace voteper_RR_ASP = .      if countryelection == 180
replace voteper_GREEN_ASP = .    if countryelection == 180
replace voteper_PIRATE_ASP = .     if countryelection == 180
replace voteper_MISC_POP_ASP = .  if countryelection == 180
replace voteper_SEC_NAT_ASP = .   if countryelection == 180
replace voteper_REL_ASP =.       if countryelection == 180
replace voteper_OTHERR_ASP = .   if countryelection == 180
replace voteper_OTHERL_ASP = .    if countryelection == 180

*1954*
replace string_PSparties = "Fianna Fail (43.4), Fine Gael (32), Labour (12.1)" if countryelection == 181
replace string_CPparties = "Indep/Other (5.5, Oth)" if countryelection == 181
replace string_SCparties = "Clann na Talmhan (3.8, Rural.Pop), Clann na Poblechta (3.1, Nat)" if countryelection == 181
replace string_ASparties = "Sinn Fein (0.1, Nat)" if countryelection == 181

replace voteper_PSparties = 87.5  if countryelection == 181
replace voteper_CPparties =  5.5 if countryelection == 181
replace voteper_SCparties =  6.9  if countryelection == 181
replace voteper_ASparties =  0.1 if countryelection == 181

replace voteper_EL_ASP = .    if countryelection == 181
replace voteper_RL_ASP = .       if countryelection == 181
replace voteper_ER_ASP = .        if countryelection == 181
replace voteper_RR_ASP = .      if countryelection == 181
replace voteper_GREEN_ASP = .    if countryelection == 181
replace voteper_PIRATE_ASP = .     if countryelection == 181
replace voteper_MISC_POP_ASP = .  if countryelection == 181
replace voteper_SEC_NAT_ASP = 0.1   if countryelection == 181
replace voteper_REL_ASP =.       if countryelection == 181
replace voteper_OTHERR_ASP = .   if countryelection == 181
replace voteper_OTHERL_ASP = .    if countryelection == 181

*1957*
replace string_PSparties = "Fianna Fail (48.1), Fine Gael (26.6), Labour (9.1)" if countryelection == 182
replace string_CPparties = "Indep/Other (6.7, Oth)" if countryelection == 182
replace string_SCparties = "Clann na Talmhan (2.4, Rural.Pop)" if countryelection == 182
replace string_ASparties = "Sinn Fein (5.3, Nat), Clann na Poblechta (1.7, Nat)" if countryelection == 182

replace voteper_PSparties = 83.8  if countryelection == 182
replace voteper_CPparties =  6.7 if countryelection == 182
replace voteper_SCparties =  2.4   if countryelection == 182
replace voteper_ASparties =  7.0 if countryelection == 182

replace voteper_EL_ASP = .    if countryelection == 182
replace voteper_RL_ASP = .       if countryelection == 182
replace voteper_ER_ASP = .        if countryelection == 182
replace voteper_RR_ASP = .      if countryelection == 182
replace voteper_GREEN_ASP = .    if countryelection == 182
replace voteper_PIRATE_ASP = .     if countryelection == 182
replace voteper_MISC_POP_ASP = .  if countryelection == 182
replace voteper_SEC_NAT_ASP = 7   if countryelection == 182
replace voteper_REL_ASP =.       if countryelection == 182
replace voteper_OTHERR_ASP = .   if countryelection == 182
replace voteper_OTHERL_ASP = .    if countryelection == 182

*1961*
replace string_PSparties = "Fianna Fail (43.8), Fine Gael (32), Labour (11.6)" if countryelection == 183
replace string_CPparties = "Indep/Other (5.8, Oth), National Progress Dem (1, LW)" if countryelection == 183
replace string_SCparties = "Clann na Talmhan (1.5, Rural.Pop)" if countryelection == 183
replace string_ASparties = "Sinn Fein (3.1, Nat), Clann na Poblechta (1.1, Nat)" if countryelection == 183

replace voteper_PSparties = 87.4  if countryelection == 183
replace voteper_CPparties =  6.8 if countryelection == 183
replace voteper_SCparties =  1.5   if countryelection == 183
replace voteper_ASparties =  4.2 if countryelection == 183

replace voteper_EL_ASP = .    if countryelection == 183
replace voteper_RL_ASP = .       if countryelection == 183
replace voteper_ER_ASP = .        if countryelection == 183
replace voteper_RR_ASP = .      if countryelection == 183
replace voteper_GREEN_ASP = .    if countryelection == 183
replace voteper_PIRATE_ASP = .     if countryelection == 183
replace voteper_MISC_POP_ASP = .  if countryelection == 183
replace voteper_SEC_NAT_ASP = 4.2   if countryelection == 183
replace voteper_REL_ASP =.       if countryelection == 183
replace voteper_OTHERR_ASP = .   if countryelection == 183
replace voteper_OTHERL_ASP = .    if countryelection == 183

*1965*
replace string_PSparties = "Fianna Fail (47.7), Fine Gael (34.1), Labour (15.4)" if countryelection == 184
replace string_CPparties = "Indep/Other (2.0, Oth)" if countryelection == 184
replace string_SCparties = "NA" if countryelection == 184
replace string_ASparties = "Clann na Poblechta (0.8, Nat)" if countryelection == 184

replace voteper_PSparties = 97.2  if countryelection == 184
replace voteper_CPparties =  2    if countryelection == 184
replace voteper_SCparties =  0   if countryelection == 184
replace voteper_ASparties =  0.8 if countryelection == 184

replace voteper_EL_ASP = .    if countryelection == 184
replace voteper_RL_ASP = .       if countryelection == 184
replace voteper_ER_ASP = .        if countryelection == 184
replace voteper_RR_ASP = .      if countryelection == 184
replace voteper_GREEN_ASP = .    if countryelection == 184
replace voteper_PIRATE_ASP = .     if countryelection == 184
replace voteper_MISC_POP_ASP = .  if countryelection == 184
replace voteper_SEC_NAT_ASP = 0.8   if countryelection == 184
replace voteper_REL_ASP =.       if countryelection == 184
replace voteper_OTHERR_ASP = .   if countryelection == 184
replace voteper_OTHERL_ASP = .    if countryelection == 184

*1969*
replace string_PSparties = "Fianna Fail (45.7), Fine Gael (34.1), Labour (17)" if countryelection == 185
replace string_CPparties = "Indep/Other (3.2, Oth)" if countryelection == 185
replace string_SCparties = "NA" if countryelection == 185
replace string_ASparties = "NA" if countryelection == 185

replace voteper_PSparties = 96.8  if countryelection == 185
replace voteper_CPparties =  3.2  if countryelection == 185
replace voteper_SCparties =  0    if countryelection == 185
replace voteper_ASparties =  0    if countryelection == 185

replace voteper_EL_ASP = .    if countryelection == 185
replace voteper_RL_ASP = .       if countryelection == 185
replace voteper_ER_ASP = .        if countryelection == 185
replace voteper_RR_ASP = .      if countryelection == 185
replace voteper_GREEN_ASP = .    if countryelection == 185
replace voteper_PIRATE_ASP = .     if countryelection == 185
replace voteper_MISC_POP_ASP = .  if countryelection == 185
replace voteper_SEC_NAT_ASP = .   if countryelection == 185
replace voteper_REL_ASP =.       if countryelection == 185
replace voteper_OTHERR_ASP = .   if countryelection == 185
replace voteper_OTHERL_ASP = .    if countryelection == 185

*1973*
replace string_PSparties = "Fianna Fail (46.2), Fine Gael (35.1), Labour (13.7)" if countryelection == 186
replace string_CPparties = "Indep/Other (2.9, Oth)" if countryelection == 186
replace string_SCparties = "NA" if countryelection == 186
replace string_ASparties = "Irish Unity (0.9, Nat), Workers' Party (1.1,Com)" if countryelection == 186

replace voteper_PSparties = 95  if countryelection == 186
replace voteper_CPparties =  2.9 if countryelection == 186
replace voteper_SCparties =  0   if countryelection == 186
replace voteper_ASparties =  2  if countryelection == 186

replace voteper_EL_ASP = 1.1    if countryelection == 186
replace voteper_RL_ASP = .       if countryelection == 186
replace voteper_ER_ASP = .        if countryelection == 186
replace voteper_RR_ASP = .      if countryelection == 186
replace voteper_GREEN_ASP = .    if countryelection == 186
replace voteper_PIRATE_ASP = .     if countryelection == 186
replace voteper_MISC_POP_ASP = .  if countryelection == 186
replace voteper_SEC_NAT_ASP = 0.9   if countryelection == 186
replace voteper_REL_ASP =.       if countryelection == 186
replace voteper_OTHERR_ASP = .   if countryelection == 186
replace voteper_OTHERL_ASP = .    if countryelection == 186

*1977*
replace string_PSparties = "Fianna Fail (50.6), Fine Gael (30.5), Labour (11.6)" if countryelection == 187
replace string_CPparties = "Indep/Other (5.5, Oth)" if countryelection == 187
replace string_SCparties = "NA" if countryelection == 187
replace string_ASparties = "Irish Rep Socialist(0.1, Com), Workers' Party (1.7,Com)" if countryelection == 187

replace voteper_PSparties = 92.7  if countryelection == 187
replace voteper_CPparties =  5.5 if countryelection == 187
replace voteper_SCparties =  0   if countryelection == 187
replace voteper_ASparties =  1.8 if countryelection == 187

replace voteper_EL_ASP = 1.8    if countryelection == 187
replace voteper_RL_ASP = .       if countryelection == 187
replace voteper_ER_ASP = .        if countryelection == 187
replace voteper_RR_ASP = .      if countryelection == 187
replace voteper_GREEN_ASP = .    if countryelection == 187
replace voteper_PIRATE_ASP = .     if countryelection == 187
replace voteper_MISC_POP_ASP = .  if countryelection == 187
replace voteper_SEC_NAT_ASP = .   if countryelection == 187
replace voteper_REL_ASP =.       if countryelection == 187
replace voteper_OTHERR_ASP = .   if countryelection == 187
replace voteper_OTHERL_ASP = .    if countryelection == 187

*1981*
replace string_PSparties = "Fianna Fail (45.3), Fine Gael (36.5), Labour (9.9)" if countryelection == 188
replace string_CPparties = "Indep/Other (3.7, Oth)" if countryelection == 188
replace string_SCparties = "NA" if countryelection == 188
replace string_ASparties = "Workers' Party (1.7,Com), Anti-H Block (2.5, Nat), Socialist Labour (0.4, LW)" if countryelection == 188

replace voteper_PSparties = 91.7  if countryelection == 188
replace voteper_CPparties =  3.7 if countryelection == 188
replace voteper_SCparties =  0   if countryelection == 188
replace voteper_ASparties =  4.6 if countryelection == 188

replace voteper_EL_ASP = 1.7    if countryelection == 188
replace voteper_RL_ASP = .       if countryelection == 188
replace voteper_ER_ASP = .        if countryelection == 188
replace voteper_RR_ASP = .      if countryelection == 188
replace voteper_GREEN_ASP = .    if countryelection == 188
replace voteper_PIRATE_ASP = .     if countryelection == 188
replace voteper_MISC_POP_ASP = .  if countryelection == 188
replace voteper_SEC_NAT_ASP = 2.5   if countryelection == 188
replace voteper_REL_ASP =.       if countryelection == 188
replace voteper_OTHERR_ASP = .   if countryelection == 188
replace voteper_OTHERL_ASP = 0.4    if countryelection == 188

*1982a*
replace string_PSparties = "Fianna Fail (47.3), Fine Gael (37.3), Labour (9.1)" if countryelection == 189
replace string_CPparties = "Indep/Other (2.8, Oth)" if countryelection == 189
replace string_SCparties = "NA" if countryelection == 189
replace string_ASparties = "Sinn Fein (1, Nat), Workers' Party (2.3,Com), Irish Rep Socialist (0.2, LW)" if countryelection == 189

replace voteper_PSparties = 93.7 if countryelection == 189
replace voteper_CPparties =  2.8 if countryelection == 189
replace voteper_SCparties =  0   if countryelection == 189
replace voteper_ASparties =  3.5 if countryelection == 189

replace voteper_EL_ASP = 2.3    if countryelection == 189
replace voteper_RL_ASP = .       if countryelection == 189
replace voteper_ER_ASP = .        if countryelection == 189
replace voteper_RR_ASP = .      if countryelection == 189
replace voteper_GREEN_ASP = .    if countryelection == 189
replace voteper_PIRATE_ASP = .     if countryelection == 189
replace voteper_MISC_POP_ASP = .  if countryelection == 189
replace voteper_SEC_NAT_ASP = 1   if countryelection == 189
replace voteper_REL_ASP =.       if countryelection == 189
replace voteper_OTHERR_ASP = .   if countryelection == 189
replace voteper_OTHERL_ASP = 0.2    if countryelection == 189

*1982b*
replace string_PSparties = "Fianna Fail (45.2), Fine Gael (39.2), Labour (9.4)" if countryelection == 190
replace string_CPparties = "Indep/Other (2.4, Oth)" if countryelection == 190
replace string_SCparties = "NA" if countryelection == 190
replace string_ASparties = "Green Party (0.2, Green), Workers' Party (3.3,Com), Dem Socialist (0.4, OL)" if countryelection == 190

replace voteper_PSparties = 93.8  if countryelection == 190
replace voteper_CPparties =  2.4 if countryelection == 190
replace voteper_SCparties =  0   if countryelection == 190
replace voteper_ASparties =  3.9 if countryelection == 190

replace voteper_EL_ASP = 3.3    if countryelection == 190
replace voteper_RL_ASP = .       if countryelection == 190
replace voteper_ER_ASP = .        if countryelection == 190
replace voteper_RR_ASP = .      if countryelection == 190
replace voteper_GREEN_ASP = 0.2    if countryelection == 190
replace voteper_PIRATE_ASP = .     if countryelection == 190
replace voteper_MISC_POP_ASP = .  if countryelection == 190
replace voteper_SEC_NAT_ASP = .   if countryelection == 190
replace voteper_REL_ASP =.       if countryelection == 190
replace voteper_OTHERR_ASP = .   if countryelection == 190
replace voteper_OTHERL_ASP = 0.4    if countryelection == 190

*1987*
replace string_PSparties = "Fianna Fail (44.1), Fine Gael (27.1), Labour (6.4)" if countryelection == 191
replace string_CPparties = "Indep/Other (4, Oth), Progressive Dem (11.8, Lib)" if countryelection == 191
replace string_SCparties = "NA" if countryelection == 191
replace string_ASparties = "Sinn Fein (1.9, Nat), Green Party (0.4, Green), Workers' Party (3.8,Com), Dem Socialist (0.4, LW)" if countryelection == 191

replace voteper_PSparties = 77.6  if countryelection == 191
replace voteper_CPparties = 15.8 if countryelection == 191
replace voteper_SCparties =  0   if countryelection == 191
replace voteper_ASparties =  6.5 if countryelection == 191

replace voteper_EL_ASP = 3.8    if countryelection == 191
replace voteper_RL_ASP = .       if countryelection == 191
replace voteper_ER_ASP = .        if countryelection == 191
replace voteper_RR_ASP = .      if countryelection == 191
replace voteper_GREEN_ASP = 0.4    if countryelection == 191
replace voteper_PIRATE_ASP = .     if countryelection == 191
replace voteper_MISC_POP_ASP = .  if countryelection == 191
replace voteper_SEC_NAT_ASP = 1.9   if countryelection == 191
replace voteper_REL_ASP =.       if countryelection == 191
replace voteper_OTHERR_ASP = .   if countryelection == 191
replace voteper_OTHERL_ASP = 0.4    if countryelection == 191

*1989*
replace string_PSparties = "Fianna Fail (44.1), Fine Gael (29.3), Labour (9.5)" if countryelection == 192
replace string_CPparties = "Indep/Other (3.3, Oth), Progressive Dem (5.5, Lib)" if countryelection == 192
replace string_SCparties = "NA" if countryelection == 192
replace string_ASparties = "Sinn Fein (1.2, Nat), Green Party (0.6, Green), Workers' Party (5, Com), Dem Socialist (1.5, LW)" if countryelection == 192

replace voteper_PSparties = 82.9  if countryelection == 192
replace voteper_CPparties =  8.8 if countryelection == 192
replace voteper_SCparties =  0   if countryelection == 192
replace voteper_ASparties =  8.3 if countryelection == 192

replace voteper_EL_ASP = 5    if countryelection == 192
replace voteper_RL_ASP = .       if countryelection == 192
replace voteper_ER_ASP = .        if countryelection == 192
replace voteper_RR_ASP = .      if countryelection == 192
replace voteper_GREEN_ASP = 0.6    if countryelection == 192
replace voteper_PIRATE_ASP = .     if countryelection == 192
replace voteper_MISC_POP_ASP = .  if countryelection == 192
replace voteper_SEC_NAT_ASP = 1.2   if countryelection == 192
replace voteper_REL_ASP =.       if countryelection == 192
replace voteper_OTHERR_ASP = .   if countryelection == 192
replace voteper_OTHERL_ASP = 1.5    if countryelection == 192

*1992*
replace string_PSparties = "Fianna Fail (39.1), Fine Gael (24.5), Labour (19.3), Progressive Dem (4.7)" if countryelection == 193
replace string_CPparties = "Indep/Other (6, Oth), Democratic Left (2.8, LW)" if countryelection == 193
replace string_SCparties = "NA" if countryelection == 193
replace string_ASparties = "Sinn Fein (1.6, Nat), Green Party (1.4, Green), Workers' Party (0.7, Com)" if countryelection == 193

replace voteper_PSparties = 87.6  if countryelection == 193
replace voteper_CPparties =  8.8 if countryelection == 193
replace voteper_SCparties =  0   if countryelection == 193
replace voteper_ASparties =  3.7 if countryelection == 193

replace voteper_EL_ASP = 0.7    if countryelection == 193
replace voteper_RL_ASP = .       if countryelection == 193
replace voteper_ER_ASP = .        if countryelection == 193
replace voteper_RR_ASP = .      if countryelection == 193
replace voteper_GREEN_ASP = 1.4    if countryelection == 193
replace voteper_PIRATE_ASP = .     if countryelection == 193
replace voteper_MISC_POP_ASP = .  if countryelection == 193
replace voteper_SEC_NAT_ASP = 1.6   if countryelection == 193
replace voteper_REL_ASP =.       if countryelection == 193
replace voteper_OTHERR_ASP = .   if countryelection == 193
replace voteper_OTHERL_ASP = .    if countryelection == 193

*1997*
replace string_PSparties = "Fianna Fail (39.3), Fine Gael (27.9), Labour (10.4), Progressive Dem (4.7), Democratic Left (2.5, LW)" if countryelection == 194
replace string_CPparties = "Indep/Other (7.2, Oth), National Party (1.1, Rel), Christian Solidarity (0.5, Rel)" if countryelection == 194
replace string_SCparties = "NA" if countryelection == 194
replace string_ASparties = "Sinn Fein (2.5, Nat), Green Party (2.8, Green), Workers' Party (0.4, Com), Socialist Party (0.6, EL)" if countryelection == 194

replace voteper_PSparties = 84.8  if countryelection == 194
replace voteper_CPparties =  8.8 if countryelection == 194
replace voteper_SCparties =  0   if countryelection == 194
replace voteper_ASparties =  6.3 if countryelection == 194

replace voteper_EL_ASP = 1    if countryelection == 194
replace voteper_RL_ASP = .       if countryelection == 194
replace voteper_ER_ASP = .        if countryelection == 194
replace voteper_RR_ASP = .      if countryelection == 194
replace voteper_GREEN_ASP = 2.8    if countryelection == 194
replace voteper_PIRATE_ASP = .     if countryelection == 194
replace voteper_MISC_POP_ASP = .  if countryelection == 194
replace voteper_SEC_NAT_ASP = 2.5   if countryelection == 194
replace voteper_REL_ASP =.       if countryelection == 194
replace voteper_OTHERR_ASP = .   if countryelection == 194
replace voteper_OTHERL_ASP = .    if countryelection == 194

*2002*
replace string_PSparties = "Fianna Fail (41.5), Fine Gael (22.5), Labour (10.8), Progressive Dem (4)" if countryelection == 195
replace string_CPparties = "Indep/Other (9.8, Oth)" if countryelection == 195
replace string_SCparties = "NA" if countryelection == 195
replace string_ASparties = "Sinn Fein (6.5, Nat), Green Party (3.8, Green), Workers' Party (0.4, Com), Socialist Party (0.8, EL)" if countryelection == 195

replace voteper_PSparties = 78.8  if countryelection == 195
replace voteper_CPparties =  9.8 if countryelection == 195
replace voteper_SCparties =  0   if countryelection == 195
replace voteper_ASparties = 11.5 if countryelection == 195

replace voteper_EL_ASP = 1.2    if countryelection == 195
replace voteper_RL_ASP = .       if countryelection == 195
replace voteper_ER_ASP = .        if countryelection == 195
replace voteper_RR_ASP = .      if countryelection == 195
replace voteper_GREEN_ASP = 3.8    if countryelection == 195
replace voteper_PIRATE_ASP = .     if countryelection == 195
replace voteper_MISC_POP_ASP = .  if countryelection == 195
replace voteper_SEC_NAT_ASP = 6.5   if countryelection == 195
replace voteper_REL_ASP =.       if countryelection == 195
replace voteper_OTHERR_ASP = .   if countryelection == 195
replace voteper_OTHERL_ASP = .    if countryelection == 195

*2007*
replace string_PSparties = "Fianna Fail (41.6), Fine Gael (27.3), Labour (10.1), Progressive Dem (2.7)" if countryelection == 196
replace string_CPparties = "Indep/Other (5.0, Oth), Green Party (4.7, Green)" if countryelection == 196
replace string_SCparties = "NA" if countryelection == 196
replace string_ASparties = "Sinn Fein (6.9, Nat), Workers' Party (0.6, Com), Socialist Party (0.6, EL), People Before Profit (0.5, RL)" if countryelection == 196

replace voteper_PSparties = 81.7 if countryelection == 196
replace voteper_CPparties = 9.7 if countryelection == 196
replace voteper_SCparties =  0   if countryelection == 196
replace voteper_ASparties =  8.6 if countryelection == 196

replace voteper_EL_ASP = 1.2    if countryelection == 196
replace voteper_RL_ASP = 0.5       if countryelection == 196
replace voteper_ER_ASP = .        if countryelection == 196
replace voteper_RR_ASP = .      if countryelection == 196
replace voteper_GREEN_ASP = .    if countryelection == 196
replace voteper_PIRATE_ASP = .     if countryelection == 196
replace voteper_MISC_POP_ASP = .  if countryelection == 196
replace voteper_SEC_NAT_ASP = 6.9   if countryelection == 196
replace voteper_REL_ASP =.       if countryelection == 196
replace voteper_OTHERR_ASP = .   if countryelection == 196
replace voteper_OTHERL_ASP = .    if countryelection == 196

*2011*
replace string_PSparties = "Fianna Fail (17.5), Fine Gael (36.1), Labour (19.5), Green Party (1.9, Green)" if countryelection == 197
replace string_CPparties = "Indep/Other (10.8, Oth)" if countryelection == 197
replace string_SCparties = "NA" if countryelection == 197
replace string_ASparties = "Sinn Fein (9.9, Nat), Workers' Party (0.1, Com), Worker + Unemployed Action (0.4, RL), Socialist Party (1.2, EL), Left Alliance (0.5, RL), People Before Profit (1, RL), New Vision (1.1, MISC_POP)" if countryelection == 197

replace voteper_PSparties = 75  if countryelection == 197
replace voteper_CPparties = 10.8 if countryelection == 197
replace voteper_SCparties =  0   if countryelection == 197
replace voteper_ASparties = 14.2 if countryelection == 197

replace voteper_EL_ASP = 1.3    if countryelection == 197
replace voteper_RL_ASP = 1.9       if countryelection == 197
replace voteper_ER_ASP = .        if countryelection == 197
replace voteper_RR_ASP = .      if countryelection == 197
replace voteper_GREEN_ASP = .    if countryelection == 197
replace voteper_PIRATE_ASP = .     if countryelection == 197
replace voteper_MISC_POP_ASP = 1.1  if countryelection == 197
replace voteper_SEC_NAT_ASP = 9.9   if countryelection == 197
replace voteper_REL_ASP =.       if countryelection == 197
replace voteper_OTHERR_ASP = .   if countryelection == 197
replace voteper_OTHERL_ASP = .    if countryelection == 197

*2016*
replace string_PSparties = "Fianna Fail (24.4), Fine Gael (25.5), Labour (6.6), Green Party (2.7, Green)" if countryelection == 198
replace string_CPparties = "Indep/Other (15.8, Oth), Social Democrats (3, LW), Renew Ireland (2.2, Lib), Indep 4 Change (1.5, LW)" if countryelection == 198
replace string_SCparties = "NA" if countryelection == 198
replace string_ASparties = "Sinn Fein (13.9, Nat), Workers' Party (0.2, Com), Direct Democracy (0.3, Misc. Pop), Left Alliance (3.9, RL)" if countryelection == 198

replace voteper_PSparties = 59.2  if countryelection == 198
replace voteper_CPparties = 22.5 if countryelection == 198
replace voteper_SCparties =  0   if countryelection == 198
replace voteper_ASparties = 18.3 if countryelection == 198

replace voteper_EL_ASP = 0.2    if countryelection == 198
replace voteper_RL_ASP = 3.9       if countryelection == 198
replace voteper_ER_ASP = .        if countryelection == 198
replace voteper_RR_ASP = .      if countryelection == 198
replace voteper_GREEN_ASP = .    if countryelection == 198
replace voteper_PIRATE_ASP = .     if countryelection == 198
replace voteper_MISC_POP_ASP = 0.3  if countryelection == 198
replace voteper_SEC_NAT_ASP = 13.9   if countryelection == 198
replace voteper_REL_ASP =.       if countryelection == 198
replace voteper_OTHERR_ASP = .   if countryelection == 198
replace voteper_OTHERL_ASP = .    if countryelection == 198

************************************************************* Italy **********************************************************************

***** Source:  Nohlen and Stover (2010) [1953-2008]
*              Dipartimento per gli Affar Interni e Territoriali - Ministry of the Interior [2013]


*1953*
replace string_PSparties = "Christian Democracy (40.1), Socialist Unity (4.5), Liberal Party (3), Republican Party (1.6), South Tyrol PP (0.5)" if countryelection == 199
replace string_CPparties = "Other (2.3)" if countryelection == 199
replace string_SCparties = "NA" if countryelection == 199
replace string_ASparties = "Communist/PDF (22.6, Com), Italian Socialist Party (12.7, LW), National Monarchist Party (6.9, Con), Italian Social Movement (5.8, ER)" if countryelection == 199

replace voteper_PSparties = 49.7  if countryelection == 199
replace voteper_CPparties =  2.3 if countryelection == 199
replace voteper_SCparties =  0   if countryelection == 199
replace voteper_ASparties = 48 if countryelection == 199

replace voteper_EL_ASP = 22.6    if countryelection == 199
replace voteper_RL_ASP = .       if countryelection == 199
replace voteper_ER_ASP = 5.8        if countryelection == 199
replace voteper_RR_ASP = .      if countryelection == 199
replace voteper_GREEN_ASP = .    if countryelection == 199
replace voteper_PIRATE_ASP = .     if countryelection == 199
replace voteper_MISC_POP_ASP = .  if countryelection == 199
replace voteper_SEC_NAT_ASP = .   if countryelection == 199
replace voteper_REL_ASP =.       if countryelection == 199
replace voteper_OTHERR_ASP =  6.9   if countryelection == 199
replace voteper_OTHERL_ASP = 12.7    if countryelection == 199

*1958*
replace string_PSparties = "Christian Democracy (42.3), Socialist Unity (4.6), Liberal Party (3.5), Republican Party (1.6), South Tyrol PP (0.5)" if countryelection == 200
replace string_CPparties = "Other (1.1), Italian Socialist Party (14.2, LW)" if countryelection == 200
replace string_SCparties = "NA" if countryelection == 200
replace string_ASparties = "Communist/PDF (22.7, Com), National Monarchist Party (2.2, Con), People's Monarchists (2.6, Con), Italian Social Movement (4.8, ER)" if countryelection == 200

replace voteper_PSparties = 52.5  if countryelection == 200
replace voteper_CPparties = 15.3 if countryelection == 200
replace voteper_SCparties =  0  if countryelection == 200
replace voteper_ASparties = 32.3 if countryelection == 200

replace voteper_EL_ASP = 22.7    if countryelection == 200
replace voteper_RL_ASP = .       if countryelection == 200
replace voteper_ER_ASP = 4.8        if countryelection == 200
replace voteper_RR_ASP = .      if countryelection == 200
replace voteper_GREEN_ASP = .    if countryelection == 200
replace voteper_PIRATE_ASP = .     if countryelection == 200
replace voteper_MISC_POP_ASP = .  if countryelection == 200
replace voteper_SEC_NAT_ASP = .   if countryelection == 200
replace voteper_REL_ASP =.       if countryelection == 200
replace voteper_OTHERR_ASP = 4.8   if countryelection == 200
replace voteper_OTHERL_ASP = .    if countryelection == 200

*1963*
replace string_PSparties = "Christian Democracy (38.3), Italian Socialist Party (13.8) Socialist Unity (6.1), Liberal Party (7), Republican Party (1.4), South Tyrol PP (0.5)" if countryelection == 201
replace string_CPparties = "Other (0.9)" if countryelection == 201
replace string_SCparties = "NA" if countryelection == 201
replace string_ASparties = "Communist/PDF (25.3, Com), National Monarchist Party (1.7, Con), Italian Social Movement (5.1, ER)" if countryelection == 201

replace voteper_PSparties = 67.0 if countryelection == 201
replace voteper_CPparties =  0.9 if countryelection == 201
replace voteper_SCparties =  0   if countryelection == 201
replace voteper_ASparties = 32.1 if countryelection == 201

replace voteper_EL_ASP = 25.3    if countryelection == 201
replace voteper_RL_ASP = .       if countryelection == 201
replace voteper_ER_ASP = 5.1        if countryelection == 201
replace voteper_RR_ASP = .      if countryelection == 201
replace voteper_GREEN_ASP = .    if countryelection == 201
replace voteper_PIRATE_ASP = .     if countryelection == 201
replace voteper_MISC_POP_ASP = .  if countryelection == 201
replace voteper_SEC_NAT_ASP = .   if countryelection == 201
replace voteper_REL_ASP =.       if countryelection == 201
replace voteper_OTHERR_ASP = 1.7   if countryelection == 201
replace voteper_OTHERL_ASP = .    if countryelection == 201

*1968*
replace string_PSparties = "Christian Democracy (39.1), Italian Socialist Party (14.5), Liberal Party (5.8), Republican Party (2), South Tyrol PP (0.5)" if countryelection == 202
replace string_CPparties = "Other (1)" if countryelection == 202
replace string_SCparties = "NA" if countryelection == 202
replace string_ASparties = "Communist/PDF (26.9, Com), National Monarchist Party (1.3, Con), Italian Social Movement (4.5, ER), Proletarian Socialist (4.4, Com)" if countryelection == 202

replace voteper_PSparties = 61.9  if countryelection == 202
replace voteper_CPparties =  1    if countryelection == 202
replace voteper_SCparties =  0    if countryelection == 202
replace voteper_ASparties = 37.1  if countryelection == 202

replace voteper_EL_ASP = 31.3    if countryelection == 202
replace voteper_RL_ASP = .       if countryelection == 202
replace voteper_ER_ASP = 4.5        if countryelection == 202
replace voteper_RR_ASP = .      if countryelection == 202
replace voteper_GREEN_ASP = .    if countryelection == 202
replace voteper_PIRATE_ASP = .     if countryelection == 202
replace voteper_MISC_POP_ASP = .  if countryelection == 202
replace voteper_SEC_NAT_ASP = .   if countryelection == 202
replace voteper_REL_ASP =.       if countryelection == 202
replace voteper_OTHERR_ASP = 1.3   if countryelection == 202
replace voteper_OTHERL_ASP = .    if countryelection == 202

*1972*
replace string_PSparties = "Christian Democracy (38.7), Socialist Unity (5.1), Italian Socialist Party (9.6), Liberal Party (3.9), Republican Party (2.9), South Tyrol PP (0.5)" if countryelection == 203
replace string_CPparties = "Other (1.6)" if countryelection == 203
replace string_SCparties = "NA" if countryelection == 203
replace string_ASparties = "Communist/PDF (27.1, Com), Italian Social Movement (8.7, ER), Proletarian Socialist (1.9, Com)" if countryelection == 203

replace voteper_PSparties = 60.7  if countryelection == 203
replace voteper_CPparties =  1.6  if countryelection == 203
replace voteper_SCparties =  0    if countryelection == 203
replace voteper_ASparties =  37.7 if countryelection == 203

replace voteper_EL_ASP = 29    if countryelection == 203
replace voteper_RL_ASP = .       if countryelection == 203
replace voteper_ER_ASP = 8.7        if countryelection == 203
replace voteper_RR_ASP = .      if countryelection == 203
replace voteper_GREEN_ASP = .    if countryelection == 203
replace voteper_PIRATE_ASP = .     if countryelection == 203
replace voteper_MISC_POP_ASP = .  if countryelection == 203
replace voteper_SEC_NAT_ASP = .   if countryelection == 203
replace voteper_REL_ASP =.       if countryelection == 203
replace voteper_OTHERR_ASP = .   if countryelection == 203
replace voteper_OTHERL_ASP = .    if countryelection == 203

*1976*
replace string_PSparties = "Christian Democracy (38.7), Socialist Unity (3.4), Italian Socialist Party (9.6), Liberal Party (1.3), Republican Party (3.1), South Tyrol PP (0.5)" if countryelection == 204
replace string_CPparties = "Other (0.3)" if countryelection == 204
replace string_SCparties = "NA" if countryelection == 204
replace string_ASparties = "Communist/PDF (34.4, Com), Italian Social Movement (6.1, ER), Radical Party (1.1, OL), Proletarian Democracy (1.5, Com)" if countryelection == 204

replace voteper_PSparties = 56.6  if countryelection == 204
replace voteper_CPparties =  0.3 if countryelection == 204
replace voteper_SCparties =  0   if countryelection == 204
replace voteper_ASparties = 43.1 if countryelection == 204

replace voteper_EL_ASP = 35.9    if countryelection == 204
replace voteper_RL_ASP = .       if countryelection == 204
replace voteper_ER_ASP = 6.1        if countryelection == 204
replace voteper_RR_ASP = .      if countryelection == 204
replace voteper_GREEN_ASP = .    if countryelection == 204
replace voteper_PIRATE_ASP = .     if countryelection == 204
replace voteper_MISC_POP_ASP = .  if countryelection == 204
replace voteper_SEC_NAT_ASP = .   if countryelection == 204
replace voteper_REL_ASP =.       if countryelection == 204
replace voteper_OTHERR_ASP = .   if countryelection == 204
replace voteper_OTHERL_ASP = 1.1    if countryelection == 204

*1979*
replace string_PSparties = "Christian Democracy (38.3), Socialist Unity (3.8), Italian Socialist Party (9.8), Liberal Party (1.9), Republican Party (3), South Tyrol PP (0.5)" if countryelection == 205
replace string_CPparties = "Other (2.1)" if countryelection == 205
replace string_SCparties = "Communist/PDF (30.4, Com)" if countryelection == 205
replace string_ASparties = "Italian Social Movement (5.3, ER), Radical Party (3.5, OL), Proletarian Democracy (1.4, EL)" if countryelection == 205

replace voteper_PSparties = 57.3  if countryelection == 205
replace voteper_CPparties =  2.1 if countryelection == 205
replace voteper_SCparties = 30.4    if countryelection == 205
replace voteper_ASparties = 10.2 if countryelection == 205

replace voteper_EL_ASP = 1.4    if countryelection == 205
replace voteper_RL_ASP = .       if countryelection == 205
replace voteper_ER_ASP = 5.3        if countryelection == 205
replace voteper_RR_ASP = .      if countryelection == 205
replace voteper_GREEN_ASP = .    if countryelection == 205
replace voteper_PIRATE_ASP = .     if countryelection == 205
replace voteper_MISC_POP_ASP = .  if countryelection == 205
replace voteper_SEC_NAT_ASP = .   if countryelection == 205
replace voteper_REL_ASP =.       if countryelection == 205
replace voteper_OTHERR_ASP = .   if countryelection == 205
replace voteper_OTHERL_ASP = 3.5    if countryelection == 205

*1983*
replace string_PSparties = "Christian Democracy (32.9), Socialist Unity (4.1), Italian Socialist Party (11.4), Liberal Party (2.9), Republican Party (5.1), South Tyrol PP (0.5)" if countryelection == 206
replace string_CPparties = "Other (2.7)" if countryelection == 206
replace string_SCparties = "NA" if countryelection == 206
replace string_ASparties = "Communist/PDF (29.9, EL), Italian Social Movement (6.8, ER), Radical Party (2.2, OL), Proletarian Democracy (1.5, EL)" if countryelection == 206

replace voteper_PSparties = 56.9  if countryelection == 206
replace voteper_CPparties =  2.7 if countryelection == 206
replace voteper_SCparties =  0   if countryelection == 206
replace voteper_ASparties = 40.4 if countryelection == 206

replace voteper_EL_ASP = 31.4    if countryelection == 206
replace voteper_RL_ASP = .       if countryelection == 206
replace voteper_ER_ASP = 6.8        if countryelection == 206
replace voteper_RR_ASP = .      if countryelection == 206
replace voteper_GREEN_ASP = .    if countryelection == 206
replace voteper_PIRATE_ASP = .     if countryelection == 206
replace voteper_MISC_POP_ASP = .  if countryelection == 206
replace voteper_SEC_NAT_ASP = .   if countryelection == 206
replace voteper_REL_ASP =.       if countryelection == 206
replace voteper_OTHERR_ASP = .   if countryelection == 206
replace voteper_OTHERL_ASP = 2.2    if countryelection == 206

*1987*
replace string_PSparties = "Christian Democracy (34.3), Socialist Unity (2.9), Italian Socialist Party (14.3), Liberal Party (2.1), Republican Party (3.7), South Tyrol PP (0.5)" if countryelection == 207
replace string_CPparties = "Other (2.9)" if countryelection == 207
replace string_SCparties = "NA" if countryelection == 207
replace string_ASparties = "Communist/PDF (26.6, Com), Greens (2.5, Green), Italian Social Movement (5.9, ER), Radical Party (2.6, Lib), Proletarian Democracy (1.7, Com)" if countryelection == 207

replace voteper_PSparties = 57.8  if countryelection == 207
replace voteper_CPparties =  2.9 if countryelection == 207
replace voteper_SCparties =  0  if countryelection == 207
replace voteper_ASparties = 39.3 if countryelection == 207

replace voteper_EL_ASP = 28.3    if countryelection == 207
replace voteper_RL_ASP = .       if countryelection == 207
replace voteper_ER_ASP = 5.9        if countryelection == 207
replace voteper_RR_ASP = .      if countryelection == 207
replace voteper_GREEN_ASP = 2.5    if countryelection == 207
replace voteper_PIRATE_ASP = .     if countryelection == 207
replace voteper_MISC_POP_ASP = .  if countryelection == 207
replace voteper_SEC_NAT_ASP = .   if countryelection == 207
replace voteper_REL_ASP =.       if countryelection == 207
replace voteper_OTHERR_ASP = .   if countryelection == 207
replace voteper_OTHERL_ASP = 2.6    if countryelection == 207

*1992*
replace string_PSparties = "Christian Democracy (29.6), Socialist Unity (2.7), Italian Socialist Party (13.6), Liberal Party (2.9), Republican Party (4.5), South Tyrol PP (0.5)" if countryelection == 208
replace string_CPparties = "Democratic Party of the Left (16.1), Other (4.6)" if countryelection == 208
replace string_SCparties = "NA" if countryelection == 208
replace string_ASparties = "Communist Refoundation (5.6, Com), Greens (2.8, Green), The Network (1.9, Lib), Lega Nord (8.6, Sec), Italian Social Movement (5.4, ER), Panella List (1.2, Lib)" if countryelection == 208

replace voteper_PSparties = 53.8  if countryelection == 208
replace voteper_CPparties = 20.7 if countryelection == 208
replace voteper_SCparties =  0   if countryelection == 208
replace voteper_ASparties = 25.5  if countryelection == 208

replace voteper_EL_ASP = 5.6    if countryelection == 208
replace voteper_RL_ASP = .       if countryelection == 208
replace voteper_ER_ASP = 5.4        if countryelection == 208
replace voteper_RR_ASP = .     if countryelection == 208
replace voteper_GREEN_ASP = 2.8    if countryelection == 208
replace voteper_PIRATE_ASP = .     if countryelection == 208
replace voteper_MISC_POP_ASP = .  if countryelection == 208
replace voteper_SEC_NAT_ASP = 8.6    if countryelection == 208
replace voteper_REL_ASP =.       if countryelection == 208
replace voteper_OTHERR_ASP = .   if countryelection == 208
replace voteper_OTHERL_ASP = 3.1    if countryelection == 208

*1994*
replace string_PSparties = "Italian People's Party (11.1), Democratic Party of the Left (20.4), Socialist Party (2.2), Segni Pact (4.7), South Tyrol PP (0.6)" if countryelection == 209
replace string_CPparties = "Other (2.1), Democratic Alliance (1.2, Lib)" if countryelection == 209
replace string_SCparties = "Greens (2.7, Green)" if countryelection == 209
replace string_ASparties = "Forza Italia (21, RW), National Alliance (13.5, Nat), Communist Refoundation (6, Com), The Network (1.9, Lib), Lega Nord (8.4, Sec), Panella List (3.5, Lib)" if countryelection == 209

replace voteper_PSparties =  38 if countryelection == 209
replace voteper_CPparties =  3.3  if countryelection == 209
replace voteper_SCparties =  2.7   if countryelection == 209
replace voteper_ASparties =  56 if countryelection == 209

replace voteper_EL_ASP = 6    if countryelection == 209
replace voteper_RL_ASP = .       if countryelection == 209
replace voteper_ER_ASP = .        if countryelection == 209
replace voteper_RR_ASP = .      if countryelection == 209
replace voteper_GREEN_ASP = 2.7    if countryelection == 209
replace voteper_PIRATE_ASP = .     if countryelection == 209
replace voteper_MISC_POP_ASP = .  if countryelection == 209
replace voteper_SEC_NAT_ASP = 8.4   if countryelection == 209
replace voteper_REL_ASP =.       if countryelection == 209
replace voteper_OTHERR_ASP = 33.5   if countryelection == 209
replace voteper_OTHERL_ASP = 5.4    if countryelection == 209

*1996*
replace string_PSparties = "Christian Democratic Centre (5.8), Forza Italia (20.6), Greens (2.5), Poplars for Italy (6.8), Italian Renewal (4.3), Democratic Party of the Left (21.1), South Tyrol PP (0.6)" if countryelection == 210
replace string_CPparties = "Other (1.2)" if countryelection == 210
replace string_SCparties = "National Alliance (15.7), Panella List (1.9)" if countryelection == 210
replace string_ASparties = "Lega Nord (10.1, Sec), Communist Refoundation (8.6, Com), Tricolour Flame (0.9, ER)" if countryelection == 210

replace voteper_PSparties = 61.7 if countryelection == 210
replace voteper_CPparties =  1.2 if countryelection == 210
replace voteper_SCparties = 17.6 if countryelection == 210
replace voteper_ASparties = 19.6 if countryelection == 210

replace voteper_EL_ASP = 8.6    if countryelection == 210
replace voteper_RL_ASP = .       if countryelection == 210
replace voteper_ER_ASP = 0.9        if countryelection == 210
replace voteper_RR_ASP = .      if countryelection == 210
replace voteper_GREEN_ASP = .    if countryelection == 210
replace voteper_PIRATE_ASP = .     if countryelection == 210
replace voteper_MISC_POP_ASP = .  if countryelection == 210
replace voteper_SEC_NAT_ASP = 10.1   if countryelection == 210
replace voteper_REL_ASP =.       if countryelection == 210
replace voteper_OTHERR_ASP = .   if countryelection == 210
replace voteper_OTHERL_ASP = .    if countryelection == 210

*2001*
replace string_PSparties = "CDC (3.2), Forza Italia (29.5), Democrats (16.6), The Daisy (14.5), Sunflower (2.2, Greens), South Tyrol PP (0.5)" if countryelection == 211
replace string_CPparties = "European Democracy (2.4, CP), Other (2)" if countryelection == 211
replace string_SCparties = "National Alliance (12), Lega Nord (3.9), Communist Refoundation Party (5, Com), Party of Italian Communists (1.7, Com)" if countryelection == 211
replace string_ASparties = "Italy of Values (3.9, MISC_POP), Bonino List (2.2, OL), Tricolour Flame (0.4, ER)" if countryelection == 211

replace voteper_PSparties = 66.5 if countryelection == 211
replace voteper_CPparties = 4.4 if countryelection == 211
replace voteper_SCparties = 22.6    if countryelection == 211
replace voteper_ASparties = 6.5  if countryelection == 211

replace voteper_EL_ASP = .    if countryelection == 211
replace voteper_RL_ASP = .       if countryelection == 211
replace voteper_ER_ASP = 0.4        if countryelection == 211
replace voteper_RR_ASP = .      if countryelection == 211
replace voteper_GREEN_ASP = .    if countryelection == 211
replace voteper_PIRATE_ASP = .     if countryelection == 211
replace voteper_MISC_POP_ASP = 3.9 if countryelection == 211
replace voteper_SEC_NAT_ASP = .   if countryelection == 211
replace voteper_REL_ASP =.       if countryelection == 211
replace voteper_OTHERR_ASP = .   if countryelection == 211
replace voteper_OTHERL_ASP = 2.2    if countryelection == 211

*2006*
replace string_PSparties = "Olive Tree (31.3), Forza Italia (23.7), Union of the Center (6.8), DC/New PSI (0.7), UDEUR (1.4), Greens (2.1, Greens), South Tyrol PP (0.5), Pensioners (0.9, Pen), Other Union (0.6)" if countryelection == 212
replace string_CPparties = "Other (2)" if countryelection == 212
replace string_SCparties = "National Alliance (12.3), Italy of Values (2.3, MISC_POP), Lega Nord (4.6), Party of Italian Communists (2.3, Com), Communist Refoundation Party (5.8, Com), Rose in the Fist (2.6, LW)" if countryelection == 212
replace string_ASparties = "NA" if countryelection == 212

replace voteper_PSparties = 74.2  if countryelection == 212
replace voteper_CPparties =  2    if countryelection == 212
replace voteper_SCparties = 29.9   if countryelection == 212
replace voteper_ASparties =  0   if countryelection == 212

replace voteper_EL_ASP = .    if countryelection == 212
replace voteper_RL_ASP = .       if countryelection == 212
replace voteper_ER_ASP = .        if countryelection == 212
replace voteper_RR_ASP = .      if countryelection == 212
replace voteper_GREEN_ASP = .    if countryelection == 212
replace voteper_PIRATE_ASP = .     if countryelection == 212
replace voteper_MISC_POP_ASP = .  if countryelection == 212
replace voteper_SEC_NAT_ASP = .   if countryelection == 212
replace voteper_REL_ASP =.       if countryelection == 212
replace voteper_OTHERR_ASP = .   if countryelection == 212
replace voteper_OTHERL_ASP = .    if countryelection == 212

*2008*
replace string_PSparties = "Olive Tree (33.1), Forza Italia (37.2), Autonomy Movement (1.1), Union of the Center (5.7), South Tyrol PP (0.5)" if countryelection == 213
replace string_CPparties = "Italian Socialist (1, LW), Other (2.3)" if countryelection == 213
replace string_SCparties = "Lega Nord (8.1, Sec), Greens (0.8, Greens), Left-Rainbow (2.3, RL), Italy of Values (4.4, MISC_POP)" if countryelection == 213
replace string_ASparties = "Critical Left (0.5, Com), Tricolour Flame (2.4, ER), Worker's Communist (0.6, Com)" if countryelection == 213

replace voteper_PSparties = 77.6  if countryelection == 213
replace voteper_CPparties =  3.3 if countryelection == 213
replace voteper_SCparties = 15.6   if countryelection == 213
replace voteper_ASparties =  3.5  if countryelection == 213

replace voteper_EL_ASP = 1.1    if countryelection == 213
replace voteper_RL_ASP = .       if countryelection == 213
replace voteper_ER_ASP = 2.4        if countryelection == 213
replace voteper_RR_ASP = .      if countryelection == 213
replace voteper_GREEN_ASP = .    if countryelection == 213
replace voteper_PIRATE_ASP = .     if countryelection == 213
replace voteper_MISC_POP_ASP = .  if countryelection == 213
replace voteper_SEC_NAT_ASP = .   if countryelection == 213
replace voteper_REL_ASP =.       if countryelection == 213
replace voteper_OTHERR_ASP = .   if countryelection == 213
replace voteper_OTHERL_ASP = .    if countryelection == 213

*2013*
replace string_PSparties = "Democratic Party (25.4), People of Freedom (21.6), Civic Choice (8.3), Democratic Centre (0.5, Lib), Autonomy Movement (0.4), Mino Berlusconi Aligned (0.5), Union of the Center (1.8), South Tyrol PP (0.4), Future and Freedom (0.5)" if countryelection == 214
replace string_CPparties = "ACT (1.1, Lib), Other (0.3)" if countryelection == 214
replace string_SCparties = "Lega Nord (4.1, Sec), Left-Ecology (3.2, RL), Brothers of Italy (2, Nat), The Right (0.7, ER)" if countryelection == 214
replace string_ASparties = "Five Star Movement (25.6, MISC_POP), Civil Revolution (2.3, RL), Greens (0.4), New Force (0.3, ER), Communists (0.3,EL), Tricolour/Casa Pound (0.3, ER)" if countryelection == 214

replace voteper_PSparties = 59.4 if countryelection == 214
replace voteper_CPparties =  1.4 if countryelection == 214
replace voteper_SCparties = 10.0   if countryelection == 214
replace voteper_ASparties = 29.2 if countryelection == 214

replace voteper_EL_ASP = 0.3    if countryelection == 214
replace voteper_RL_ASP = 2.3       if countryelection == 214
replace voteper_ER_ASP = 0.6        if countryelection == 214
replace voteper_RR_ASP = .      if countryelection == 214
replace voteper_GREEN_ASP = 0.4    if countryelection == 214
replace voteper_PIRATE_ASP = .     if countryelection == 214
replace voteper_MISC_POP_ASP = 25.6  if countryelection == 214
replace voteper_SEC_NAT_ASP = .   if countryelection == 214
replace voteper_REL_ASP =.       if countryelection == 214
replace voteper_OTHERR_ASP = .   if countryelection == 214
replace voteper_OTHERL_ASP = .    if countryelection == 214



***************************************************** LUXEMBOURG ******************************************************************

***** Source:  Nohlen and Stover (2010) [1951-2004]
*              Elections.Public.Lu (Luxembourg Government Elections Website) [2009-2014]


*1951*
replace string_PSparties = "Christian Social People's Party (42.1), LSAP (33.8), Democratic Party (20.9)" if countryelection == 215
replace string_CPparties = "NA" if countryelection == 215
replace string_SCparties = "NA" if countryelection == 215
replace string_ASparties = "Communist (3.2, Com)" if countryelection == 215

replace voteper_PSparties = 96.8  if countryelection == 215
replace voteper_CPparties = 0 if countryelection == 215
replace voteper_SCparties = 0    if countryelection == 215
replace voteper_ASparties = 3.2 if countryelection == 215

replace voteper_EL_ASP = 3.2    if countryelection == 215
replace voteper_RL_ASP = .       if countryelection == 215
replace voteper_ER_ASP = .        if countryelection == 215
replace voteper_RR_ASP = .      if countryelection == 215
replace voteper_GREEN_ASP = .    if countryelection == 215
replace voteper_PIRATE_ASP = .     if countryelection == 215
replace voteper_MISC_POP_ASP = .  if countryelection == 215
replace voteper_SEC_NAT_ASP = .   if countryelection == 215
replace voteper_REL_ASP =.       if countryelection == 215
replace voteper_OTHERR_ASP = .   if countryelection == 215
replace voteper_OTHERL_ASP = .    if countryelection == 215

*1954*
replace string_PSparties = "Christian Social People's Party (45.2), LSAP (32.8), Democratic Party (12.3)" if countryelection == 216
replace string_CPparties = "Middle Class Party (2.3)" if countryelection == 216
replace string_SCparties = "NA" if countryelection == 216
replace string_ASparties = "Communist (7.3, Com)" if countryelection == 216

replace voteper_PSparties = 90.3  if countryelection == 216
replace voteper_CPparties =  2.3 if countryelection == 216
replace voteper_SCparties =  0  if countryelection == 216
replace voteper_ASparties =  7.3 if countryelection == 216

replace voteper_EL_ASP = 7.3    if countryelection == 216
replace voteper_RL_ASP = .       if countryelection == 216
replace voteper_ER_ASP = .        if countryelection == 216
replace voteper_RR_ASP = .      if countryelection == 216
replace voteper_GREEN_ASP = .    if countryelection == 216
replace voteper_PIRATE_ASP = .     if countryelection == 216
replace voteper_MISC_POP_ASP = .  if countryelection == 216
replace voteper_SEC_NAT_ASP = .   if countryelection == 216
replace voteper_REL_ASP =.       if countryelection == 216
replace voteper_OTHERR_ASP = .   if countryelection == 216
replace voteper_OTHERL_ASP = .    if countryelection == 216

*1959*
replace string_PSparties = "Christian Social People's Party (38.9), LSAP (33), Democratic Party (20.3)" if countryelection == 217
replace string_CPparties = "Other (0.5)" if countryelection == 217
replace string_SCparties = "NA" if countryelection == 217
replace string_ASparties = "Communist (7.2, Com)" if countryelection == 217

replace voteper_PSparties = 92.2  if countryelection == 217
replace voteper_CPparties =  0.5  if countryelection == 217
replace voteper_SCparties =  0    if countryelection == 217
replace voteper_ASparties =  7.2  if countryelection == 217

replace voteper_EL_ASP = 7.2    if countryelection == 217
replace voteper_RL_ASP = .       if countryelection == 217
replace voteper_ER_ASP = .        if countryelection == 217
replace voteper_RR_ASP = .      if countryelection == 217
replace voteper_GREEN_ASP = .    if countryelection == 217
replace voteper_PIRATE_ASP = .     if countryelection == 217
replace voteper_MISC_POP_ASP = .  if countryelection == 217
replace voteper_SEC_NAT_ASP = .   if countryelection == 217
replace voteper_REL_ASP =.       if countryelection == 217
replace voteper_OTHERR_ASP = .   if countryelection == 217
replace voteper_OTHERL_ASP = .    if countryelection == 217

*1964*
replace string_PSparties = "Christian Social People's Party (35.7), LSAP (35.9), Democratic Party (12.2)" if countryelection == 218
replace string_CPparties = "NA" if countryelection == 218
replace string_SCparties = "NA" if countryelection == 218
replace string_ASparties = "Communist (10.4, Com), Popular Independent Party (5.8, MISC_POP)" if countryelection == 218

replace voteper_PSparties = 83.8  if countryelection == 218
replace voteper_CPparties =  0  if countryelection == 218
replace voteper_SCparties =  0   if countryelection == 218
replace voteper_ASparties = 16.2 if countryelection == 218

replace voteper_EL_ASP = 10.4    if countryelection == 218
replace voteper_RL_ASP = .       if countryelection == 218
replace voteper_ER_ASP = .        if countryelection == 218
replace voteper_RR_ASP = .      if countryelection == 218
replace voteper_GREEN_ASP = .    if countryelection == 218
replace voteper_PIRATE_ASP = .     if countryelection == 218
replace voteper_MISC_POP_ASP = 5.8  if countryelection == 218
replace voteper_SEC_NAT_ASP = .   if countryelection == 218
replace voteper_REL_ASP =.       if countryelection == 218
replace voteper_OTHERR_ASP = .   if countryelection == 218
replace voteper_OTHERL_ASP = .    if countryelection == 218

*1968*
replace string_PSparties = "Christian Social People's Party (37.5), LSAP (31), Democratic Party (18)" if countryelection == 219
replace string_CPparties = "Other (0.4)" if countryelection == 219
replace string_SCparties = "NA" if countryelection == 219
replace string_ASparties = "Communist (13.1, Com)" if countryelection == 219

replace voteper_PSparties = 86.5  if countryelection == 219
replace voteper_CPparties =  0.4  if countryelection == 219
replace voteper_SCparties =  0    if countryelection == 219
replace voteper_ASparties = 13.1  if countryelection == 219

replace voteper_EL_ASP = 13.1    if countryelection == 219
replace voteper_RL_ASP = .       if countryelection == 219
replace voteper_ER_ASP = .        if countryelection == 219
replace voteper_RR_ASP = .      if countryelection == 219
replace voteper_GREEN_ASP = .    if countryelection == 219
replace voteper_PIRATE_ASP = .     if countryelection == 219
replace voteper_MISC_POP_ASP = .  if countryelection == 219
replace voteper_SEC_NAT_ASP = .   if countryelection == 219
replace voteper_REL_ASP =.       if countryelection == 219
replace voteper_OTHERR_ASP = .   if countryelection == 219
replace voteper_OTHERL_ASP = .    if countryelection == 219

*1974*
replace string_PSparties = "Christian Social People's Party (29.9), LSAP (27), Democratic Party (23.1)" if countryelection == 220
replace string_CPparties = "Other (0.4), SDP (10.1, LW), Liberal (0.6, Lib)" if countryelection == 220
replace string_SCparties = "NA" if countryelection == 220
replace string_ASparties = "Communist (8.8, Com)" if countryelection == 220

replace voteper_PSparties = 80  if countryelection == 220
replace voteper_CPparties = 11.1 if countryelection == 220
replace voteper_SCparties = 0    if countryelection == 220
replace voteper_ASparties = 8.8 if countryelection == 220

replace voteper_EL_ASP = 8.8    if countryelection == 220
replace voteper_RL_ASP = .       if countryelection == 220
replace voteper_ER_ASP = .        if countryelection == 220
replace voteper_RR_ASP = .      if countryelection == 220
replace voteper_GREEN_ASP = .    if countryelection == 220
replace voteper_PIRATE_ASP = .     if countryelection == 220
replace voteper_MISC_POP_ASP = .  if countryelection == 220
replace voteper_SEC_NAT_ASP = .   if countryelection == 220
replace voteper_REL_ASP =.       if countryelection == 220
replace voteper_OTHERR_ASP = .   if countryelection == 220
replace voteper_OTHERL_ASP = .    if countryelection == 220

*1979*
replace string_PSparties = "Christian Social People's Party (36.4), LSAP (22.5), Democratic Party (21.9)" if countryelection == 221
replace string_CPparties = "Other (0.2), SDP (6.4, LW), Liberal (0.2, Lib), Enrole d'Forces (4.6, CP)" if countryelection == 221
replace string_SCparties = "NA" if countryelection == 221
replace string_ASparties = "Communist (4.9, Com), Independent Socialist (2, OL), Green Alternative (0.9, Green)" if countryelection == 221

replace voteper_PSparties = 80.8  if countryelection == 221
replace voteper_CPparties = 11.4 if countryelection == 221
replace voteper_SCparties = 0    if countryelection == 221
replace voteper_ASparties = 7.8 if countryelection == 221

replace voteper_EL_ASP = 4.9    if countryelection == 221
replace voteper_RL_ASP = .       if countryelection == 221
replace voteper_ER_ASP = .        if countryelection == 221
replace voteper_RR_ASP = .      if countryelection == 221
replace voteper_GREEN_ASP = 0.9    if countryelection == 221
replace voteper_PIRATE_ASP = .     if countryelection == 221
replace voteper_MISC_POP_ASP = .  if countryelection == 221
replace voteper_SEC_NAT_ASP = .   if countryelection == 221
replace voteper_REL_ASP =.       if countryelection == 221
replace voteper_OTHERR_ASP = .   if countryelection == 221
replace voteper_OTHERL_ASP = 2    if countryelection == 221

*1984*
replace string_PSparties = "Christian Social People's Party (36.7), LSAP (31.8), Democratic Party (20.4)" if countryelection == 222
replace string_CPparties = "Other (0.2)" if countryelection == 222
replace string_SCparties = "NA" if countryelection == 222
replace string_ASparties = "Communist (4.4, Com), Independent Socialist (2.4, LW), Green Alternative (4.2, Green)" if countryelection == 222

replace voteper_PSparties = 88.9   if countryelection == 222
replace voteper_CPparties =  0.2 if countryelection == 222
replace voteper_SCparties =  0   if countryelection == 222
replace voteper_ASparties = 11 if countryelection == 222

replace voteper_EL_ASP = 4.4    if countryelection == 222
replace voteper_RL_ASP = .       if countryelection == 222
replace voteper_ER_ASP = .        if countryelection == 222
replace voteper_RR_ASP = .      if countryelection == 222
replace voteper_GREEN_ASP = 4.2    if countryelection == 222
replace voteper_PIRATE_ASP = .     if countryelection == 222
replace voteper_MISC_POP_ASP = .  if countryelection == 222
replace voteper_SEC_NAT_ASP = .   if countryelection == 222
replace voteper_REL_ASP =.       if countryelection == 222
replace voteper_OTHERR_ASP = .   if countryelection == 222
replace voteper_OTHERL_ASP = 2.4    if countryelection == 222

*1989*
replace string_PSparties = "Christian Social People's Party (32.4), LSAP (26.2), Democratic Party (17.2)" if countryelection == 223
replace string_CPparties = "Other (1), Green List Initative (3.8, Green)" if countryelection == 223
replace string_SCparties = "NA" if countryelection == 223
replace string_ASparties = "Communist (4.4, Com), ADR (7.9, RR), National Movement (2.3, ER), Green Alternative/ELN (4.8, Green)" if countryelection == 223

replace voteper_PSparties = 75.8  if countryelection == 223
replace voteper_CPparties =  4.8  if countryelection == 223
replace voteper_SCparties =  0   if countryelection == 223
replace voteper_ASparties = 19.4 if countryelection == 223

replace voteper_EL_ASP = 4.4    if countryelection == 223
replace voteper_RL_ASP = .       if countryelection == 223
replace voteper_ER_ASP = 2.3        if countryelection == 223
replace voteper_RR_ASP = 7.9      if countryelection == 223
replace voteper_GREEN_ASP = 4.8    if countryelection == 223
replace voteper_PIRATE_ASP = .     if countryelection == 223
replace voteper_MISC_POP_ASP = .  if countryelection == 223
replace voteper_SEC_NAT_ASP = .   if countryelection == 223
replace voteper_REL_ASP =.       if countryelection == 223
replace voteper_OTHERR_ASP = .   if countryelection == 223
replace voteper_OTHERL_ASP = .    if countryelection == 223

*1994*
replace string_PSparties = "Christian Social People's Party (30.3), LSAP (25.4), Democratic Party (19.3)" if countryelection == 224
replace string_CPparties = "Other (1.2), Greens (9.9, Green)" if countryelection == 224
replace string_SCparties = "NA" if countryelection == 224
replace string_ASparties = "Communist (1.7, Com), ADR (9, RR), National Movement (2.6, ER), New Left (0.7, RL)" if countryelection == 224

replace voteper_PSparties = 75  if countryelection == 224
replace voteper_CPparties = 11.1 if countryelection == 224
replace voteper_SCparties = 0    if countryelection == 224
replace voteper_ASparties = 14 if countryelection == 224

replace voteper_EL_ASP = 1.7    if countryelection == 224
replace voteper_RL_ASP = 0.7       if countryelection == 224
replace voteper_ER_ASP = 2.6        if countryelection == 224
replace voteper_RR_ASP = 9      if countryelection == 224
replace voteper_GREEN_ASP = .    if countryelection == 224
replace voteper_PIRATE_ASP = .     if countryelection == 224
replace voteper_MISC_POP_ASP = .  if countryelection == 224
replace voteper_SEC_NAT_ASP = .   if countryelection == 224
replace voteper_REL_ASP =.       if countryelection == 224
replace voteper_OTHERR_ASP = .   if countryelection == 224
replace voteper_OTHERL_ASP = .    if countryelection == 224

*1999*
replace string_PSparties = "Christian Social People's Party (30.1), LSAP (22.3), Democratic Party (22.4)" if countryelection == 225
replace string_CPparties = "Other (0.5), Greens (9.1, Green), Green Liberals (1.1, Green)" if countryelection == 225
replace string_SCparties = "NA" if countryelection == 225
replace string_ASparties = "The Left/Com (3.3, Com), ADR (11.3, RR)" if countryelection == 225

replace voteper_PSparties = 74.8  if countryelection == 225
replace voteper_CPparties = 10.7 if countryelection == 225
replace voteper_SCparties = 0    if countryelection == 225
replace voteper_ASparties = 14.6 if countryelection == 225

replace voteper_EL_ASP = 3.3    if countryelection == 225
replace voteper_RL_ASP = .       if countryelection == 225
replace voteper_ER_ASP = .        if countryelection == 225
replace voteper_RR_ASP = 11.3      if countryelection == 225
replace voteper_GREEN_ASP = .    if countryelection == 225
replace voteper_PIRATE_ASP = .     if countryelection == 225
replace voteper_MISC_POP_ASP = .  if countryelection == 225
replace voteper_SEC_NAT_ASP = .   if countryelection == 225
replace voteper_REL_ASP =.       if countryelection == 225
replace voteper_OTHERR_ASP = .   if countryelection == 225
replace voteper_OTHERL_ASP = .    if countryelection == 225

*2004*
replace string_PSparties = "Christian Social People's Party (36.1), LSAP (23.4), Democratic Party (16.1)" if countryelection == 226
replace string_CPparties = "Other (0.1), Greens (11.6, Green)" if countryelection == 226
replace string_SCparties = "NA" if countryelection == 226
replace string_ASparties = "Communist (0.9, Com), Die Linke (1.9, RL), ADR (10, RR)" if countryelection == 226

replace voteper_PSparties = 75.6  if countryelection == 226
replace voteper_CPparties = 11.7  if countryelection == 226
replace voteper_SCparties = 0   if countryelection == 226
replace voteper_ASparties = 12.8 if countryelection == 226

replace voteper_EL_ASP = 0.9    if countryelection == 226
replace voteper_RL_ASP = 1.9       if countryelection == 226
replace voteper_ER_ASP = .        if countryelection == 226
replace voteper_RR_ASP = 10      if countryelection == 226
replace voteper_GREEN_ASP = .    if countryelection == 226
replace voteper_PIRATE_ASP = .     if countryelection == 226
replace voteper_MISC_POP_ASP = .  if countryelection == 226
replace voteper_SEC_NAT_ASP = .   if countryelection == 226
replace voteper_REL_ASP =.       if countryelection == 226
replace voteper_OTHERR_ASP = .   if countryelection == 226
replace voteper_OTHERL_ASP = .    if countryelection == 226

*2009*
replace string_PSparties = "Christian Social People's Party (38), LSAP (21.6), Democratic Party (15)" if countryelection == 227
replace string_CPparties = "Other (0.1), Greens (11.7, Green)" if countryelection == 227
replace string_SCparties = "NA" if countryelection == 227
replace string_ASparties = "Communist (1.5, Com), Die Linke (3.3, RL), ADR (8.1, RR), Citizen List (0.8, MISC_POP)" if countryelection == 227

replace voteper_PSparties = 74.6  if countryelection == 227
replace voteper_CPparties = 11.8 if countryelection == 227
replace voteper_SCparties = 0    if countryelection == 227
replace voteper_ASparties = 13.7 if countryelection == 227

replace voteper_EL_ASP = 1.5    if countryelection == 227
replace voteper_RL_ASP = 3.3       if countryelection == 227
replace voteper_ER_ASP = .        if countryelection == 227
replace voteper_RR_ASP = 8.1      if countryelection == 227
replace voteper_GREEN_ASP = .    if countryelection == 227
replace voteper_PIRATE_ASP = .     if countryelection == 227
replace voteper_MISC_POP_ASP = 0.8  if countryelection == 227
replace voteper_SEC_NAT_ASP = .   if countryelection == 227
replace voteper_REL_ASP =.       if countryelection == 227
replace voteper_OTHERR_ASP = .   if countryelection == 227
replace voteper_OTHERL_ASP = .    if countryelection == 227

*2013*
replace string_PSparties = "Christian Social People's Party (33.7), LSAP (20.3), Democratic Party (18.3)" if countryelection == 228
replace string_CPparties = "Other (0.1), Greens (10.1, Green)" if countryelection == 228
replace string_SCparties = "NA" if countryelection == 228
replace string_ASparties = "Communist (1.6, Com), Die Linke (4.9, RL), Full Democracy (1.5, MISC_POP), ADR (6.6, RR), Pirate Party (2.9, Pirat)" if countryelection == 228

replace voteper_PSparties = 72.3  if countryelection == 228
replace voteper_CPparties = 10.2 if countryelection == 228
replace voteper_SCparties = 0    if countryelection == 228
replace voteper_ASparties = 17.5 if countryelection == 228

replace voteper_EL_ASP = 1.6    if countryelection == 228
replace voteper_RL_ASP = 4.9       if countryelection == 228
replace voteper_ER_ASP = .        if countryelection == 228
replace voteper_RR_ASP = 6.6     if countryelection == 228
replace voteper_GREEN_ASP = .    if countryelection == 228
replace voteper_PIRATE_ASP = 2.9     if countryelection == 228
replace voteper_MISC_POP_ASP = 1.5  if countryelection == 228
replace voteper_SEC_NAT_ASP = .   if countryelection == 228
replace voteper_REL_ASP =.       if countryelection == 228
replace voteper_OTHERR_ASP = .   if countryelection == 228
replace voteper_OTHERL_ASP = .    if countryelection == 228



*********************************************** MALTA ******************************************************************

*1966*
replace string_PSparties = "Labour (43.1), Nationalist (47.9)" if countryelection == 229
replace string_CPparties = "Christian Workers (6, Rel), Progressive Constitutionalists (1.4, Con), Dem Nationalist (1.3, LW)" if countryelection == 229
replace string_SCparties = "NA" if countryelection == 229
replace string_ASparties = "NA" if countryelection == 229

replace voteper_PSparties = 91 if countryelection == 229
replace voteper_CPparties = 9  if countryelection == 229
replace voteper_SCparties = 0  if countryelection == 229
replace voteper_ASparties = 0  if countryelection == 229

replace voteper_EL_ASP = .    if countryelection == 229
replace voteper_RL_ASP = .       if countryelection == 229
replace voteper_ER_ASP = .        if countryelection == 229
replace voteper_RR_ASP = .      if countryelection == 229
replace voteper_GREEN_ASP = .    if countryelection == 229
replace voteper_PIRATE_ASP = .     if countryelection == 229
replace voteper_MISC_POP_ASP = .  if countryelection == 229
replace voteper_SEC_NAT_ASP = .   if countryelection == 229
replace voteper_REL_ASP =.       if countryelection == 229
replace voteper_OTHERR_ASP = .   if countryelection == 229
replace voteper_OTHERL_ASP = .    if countryelection == 229

*1971*
replace string_PSparties = "Labour (50.8), Nationalist (48.1)" if countryelection == 230
replace string_CPparties = "Progressive Constitutionalists (1, Con)" if countryelection == 230
replace string_SCparties = "NA" if countryelection == 230
replace string_ASparties = "NA" if countryelection == 230

replace voteper_PSparties = 98.9  if countryelection == 230
replace voteper_CPparties =  1   if countryelection == 230
replace voteper_SCparties =  0   if countryelection == 230
replace voteper_ASparties = 0 if countryelection == 230

replace voteper_EL_ASP = .    if countryelection == 230
replace voteper_RL_ASP = .       if countryelection == 230
replace voteper_ER_ASP = .        if countryelection == 230
replace voteper_RR_ASP = .      if countryelection == 230
replace voteper_GREEN_ASP = .    if countryelection == 230
replace voteper_PIRATE_ASP = .     if countryelection == 230
replace voteper_MISC_POP_ASP = .  if countryelection == 230
replace voteper_SEC_NAT_ASP = .   if countryelection == 230
replace voteper_REL_ASP =.       if countryelection == 230
replace voteper_OTHERR_ASP = .   if countryelection == 230
replace voteper_OTHERL_ASP = .    if countryelection == 230

*1976*
replace string_PSparties = "Labour (51.5), Nationalist (48.5)" if countryelection == 231
replace string_CPparties = "NA" if countryelection == 231
replace string_SCparties = "NA" if countryelection == 231
replace string_ASparties = "NA" if countryelection == 231

replace voteper_PSparties = 100  if countryelection == 231
replace voteper_CPparties = 0 if countryelection == 231
replace voteper_SCparties = 0    if countryelection == 231
replace voteper_ASparties = 0 if countryelection == 231

replace voteper_EL_ASP = .    if countryelection == 231
replace voteper_RL_ASP = .       if countryelection == 231
replace voteper_ER_ASP = .        if countryelection == 231
replace voteper_RR_ASP = .      if countryelection == 231
replace voteper_GREEN_ASP = .    if countryelection == 231
replace voteper_PIRATE_ASP = .     if countryelection == 231
replace voteper_MISC_POP_ASP = .  if countryelection == 231
replace voteper_SEC_NAT_ASP = .   if countryelection == 231
replace voteper_REL_ASP =.       if countryelection == 231
replace voteper_OTHERR_ASP = .   if countryelection == 231
replace voteper_OTHERL_ASP = .    if countryelection == 231

*1981*
replace string_PSparties = "Labour (49.1), Nationalist (50.9)" if countryelection == 232
replace string_CPparties = "NA" if countryelection == 232
replace string_SCparties = "NA" if countryelection == 232
replace string_ASparties = "NA" if countryelection == 232

replace voteper_PSparties = 100  if countryelection == 232
replace voteper_CPparties = 0 if countryelection == 232
replace voteper_SCparties = 0    if countryelection == 232
replace voteper_ASparties = 0 if countryelection == 232

replace voteper_EL_ASP = .    if countryelection == 232
replace voteper_RL_ASP = .       if countryelection == 232
replace voteper_ER_ASP = .        if countryelection == 232
replace voteper_RR_ASP = .      if countryelection == 232
replace voteper_GREEN_ASP = .    if countryelection == 232
replace voteper_PIRATE_ASP = .     if countryelection == 232
replace voteper_MISC_POP_ASP = .  if countryelection == 232
replace voteper_SEC_NAT_ASP = .   if countryelection == 232
replace voteper_REL_ASP =.       if countryelection == 232
replace voteper_OTHERR_ASP = .   if countryelection == 232
replace voteper_OTHERL_ASP = .    if countryelection == 232

*1987*
replace string_PSparties = "Labour (48.9), Nationalist (50.9)" if countryelection == 233
replace string_CPparties = "Other (0.2, Other)" if countryelection == 233
replace string_SCparties = "NA" if countryelection == 233
replace string_ASparties = "Communist (0.1, Com)" if countryelection == 233

replace voteper_PSparties = 99.8  if countryelection == 233
replace voteper_CPparties =  0.2 if countryelection == 233
replace voteper_SCparties =  0   if countryelection == 233
replace voteper_ASparties =  0.1 if countryelection == 233

replace voteper_EL_ASP = 0.1    if countryelection == 233
replace voteper_RL_ASP = .       if countryelection == 233
replace voteper_ER_ASP = .        if countryelection == 233
replace voteper_RR_ASP = .      if countryelection == 233
replace voteper_GREEN_ASP = .    if countryelection == 233
replace voteper_PIRATE_ASP = .     if countryelection == 233
replace voteper_MISC_POP_ASP = .  if countryelection == 233
replace voteper_SEC_NAT_ASP = .   if countryelection == 233
replace voteper_REL_ASP =.       if countryelection == 233
replace voteper_OTHERR_ASP = .   if countryelection == 233
replace voteper_OTHERL_ASP = .    if countryelection == 233

*1992*
replace string_PSparties = "Labour (46.5), Nationalist (51.8)" if countryelection == 234
replace string_CPparties = "NA" if countryelection == 234
replace string_SCparties = "NA" if countryelection == 234
replace string_ASparties = "Democratic Alternative (1.7, Green)" if countryelection == 234

replace voteper_PSparties = 98.3  if countryelection == 234
replace voteper_CPparties =  0    if countryelection == 234
replace voteper_SCparties =  0     if countryelection == 234
replace voteper_ASparties =  1.7     if countryelection == 234

replace voteper_EL_ASP = .    if countryelection == 234
replace voteper_RL_ASP = .       if countryelection == 234
replace voteper_ER_ASP = .        if countryelection == 234
replace voteper_RR_ASP = .      if countryelection == 234
replace voteper_GREEN_ASP = 1.7    if countryelection == 234
replace voteper_PIRATE_ASP = .     if countryelection == 234
replace voteper_MISC_POP_ASP = .  if countryelection == 234
replace voteper_SEC_NAT_ASP = .   if countryelection == 234
replace voteper_REL_ASP =.       if countryelection == 234
replace voteper_OTHERR_ASP = .   if countryelection == 234
replace voteper_OTHERL_ASP = .    if countryelection == 234

*1996*
replace string_PSparties = "Labour (50.7), Nationalist (47.8)" if countryelection == 235
replace string_CPparties = "NA" if countryelection == 235
replace string_SCparties = "NA" if countryelection == 235
replace string_ASparties = "Democratic Alternative (1.5, Green)" if countryelection == 235

replace voteper_PSparties = 98.5  if countryelection == 235
replace voteper_CPparties = 0 if countryelection == 235
replace voteper_SCparties = 0    if countryelection == 235
replace voteper_ASparties = 1.5 if countryelection == 235

replace voteper_EL_ASP = .    if countryelection == 235
replace voteper_RL_ASP = .       if countryelection == 235
replace voteper_ER_ASP = .        if countryelection == 235
replace voteper_RR_ASP = .      if countryelection == 235
replace voteper_GREEN_ASP = 1.5    if countryelection == 235
replace voteper_PIRATE_ASP = .     if countryelection == 235
replace voteper_MISC_POP_ASP = .  if countryelection == 235
replace voteper_SEC_NAT_ASP = .   if countryelection == 235
replace voteper_REL_ASP =.       if countryelection == 235
replace voteper_OTHERR_ASP = .   if countryelection == 235
replace voteper_OTHERL_ASP = .    if countryelection == 235

*1998*
replace string_PSparties = "Labour (47), Nationalist (51.8)" if countryelection == 236
replace string_CPparties = "NA" if countryelection == 236
replace string_SCparties = "NA" if countryelection == 236
replace string_ASparties = "Democratic Alternative (1.2, Green)" if countryelection == 236

replace voteper_PSparties = 98.8  if countryelection == 236
replace voteper_CPparties = 0 if countryelection == 236
replace voteper_SCparties = 0    if countryelection == 236
replace voteper_ASparties = 1.2 if countryelection == 236

replace voteper_EL_ASP = .    if countryelection == 236
replace voteper_RL_ASP = .       if countryelection == 236
replace voteper_ER_ASP = .        if countryelection == 236
replace voteper_RR_ASP = .      if countryelection == 236
replace voteper_GREEN_ASP = 1.2    if countryelection == 236
replace voteper_PIRATE_ASP = .     if countryelection == 236
replace voteper_MISC_POP_ASP = .  if countryelection == 236
replace voteper_SEC_NAT_ASP = .   if countryelection == 236
replace voteper_REL_ASP =.       if countryelection == 236
replace voteper_OTHERR_ASP = .   if countryelection == 236
replace voteper_OTHERL_ASP = .    if countryelection == 236

*2003*
replace string_PSparties = "Labour (47.5), Nationalist (51.8)" if countryelection == 237
replace string_CPparties = "NA" if countryelection == 237
replace string_SCparties = "NA" if countryelection == 237
replace string_ASparties = "Democratic Alternative (0.7, Green)" if countryelection == 237

replace voteper_PSparties = 99.3 if countryelection == 237
replace voteper_CPparties = 0 if countryelection == 237
replace voteper_SCparties = 0    if countryelection == 237
replace voteper_ASparties = 0.7 if countryelection == 237

replace voteper_EL_ASP = .    if countryelection == 237
replace voteper_RL_ASP = .       if countryelection == 237
replace voteper_ER_ASP = .        if countryelection == 237
replace voteper_RR_ASP = .      if countryelection == 237
replace voteper_GREEN_ASP = 0.7    if countryelection == 237
replace voteper_PIRATE_ASP = .     if countryelection == 237
replace voteper_MISC_POP_ASP = .  if countryelection == 237
replace voteper_SEC_NAT_ASP = .   if countryelection == 237
replace voteper_REL_ASP =.       if countryelection == 237
replace voteper_OTHERR_ASP = .   if countryelection == 237
replace voteper_OTHERL_ASP = .    if countryelection == 237

*2008*
replace string_PSparties = "Labour (49.3), Nationalist (48.8)" if countryelection == 238
replace string_CPparties = "Other (0.1)" if countryelection == 238
replace string_SCparties = "NA" if countryelection == 238
replace string_ASparties = "Democratic Alternative (1.3, Green), National Action (0.5, RR)" if countryelection == 238

replace voteper_PSparties = 98.1  if countryelection == 238
replace voteper_CPparties = 0.1 if countryelection == 238
replace voteper_SCparties = 0    if countryelection == 238
replace voteper_ASparties = 1.8 if countryelection == 238

replace voteper_EL_ASP = .    if countryelection == 238
replace voteper_RL_ASP = .       if countryelection == 238
replace voteper_ER_ASP = .        if countryelection == 238
replace voteper_RR_ASP = 0.5      if countryelection == 238
replace voteper_GREEN_ASP = 1.3    if countryelection == 238
replace voteper_PIRATE_ASP = .     if countryelection == 238
replace voteper_MISC_POP_ASP = .  if countryelection == 238
replace voteper_SEC_NAT_ASP = .   if countryelection == 238
replace voteper_REL_ASP =.       if countryelection == 238
replace voteper_OTHERR_ASP = .   if countryelection == 238
replace voteper_OTHERL_ASP = .    if countryelection == 238

*2013*
replace string_PSparties = "Labour (54.8), Nationalist (43.3)" if countryelection == 239
replace string_CPparties = "NA)" if countryelection == 239
replace string_SCparties = "NA" if countryelection == 239
replace string_ASparties = "Democratic Alternative (1.8, Green)" if countryelection == 239

replace voteper_PSparties = 98.1  if countryelection == 239
replace voteper_CPparties =  0 if countryelection == 239
replace voteper_SCparties = 0    if countryelection == 239
replace voteper_ASparties =  1.8 if countryelection == 239

replace voteper_EL_ASP = .    if countryelection == 239
replace voteper_RL_ASP = .       if countryelection == 239
replace voteper_ER_ASP = .        if countryelection == 239
replace voteper_RR_ASP = .      if countryelection == 239
replace voteper_GREEN_ASP = 1.8   if countryelection == 239
replace voteper_PIRATE_ASP = .     if countryelection == 239
replace voteper_MISC_POP_ASP = .  if countryelection == 239
replace voteper_SEC_NAT_ASP = .   if countryelection == 239
replace voteper_REL_ASP =.       if countryelection == 239
replace voteper_OTHERR_ASP = .   if countryelection == 239
replace voteper_OTHERL_ASP = .    if countryelection == 239



******************************************************** NETHERLANDS *******************************************************

***** Source:  Nohlen and Stover (2010) [1952-2006]
*              NSD European Election Database [2010-2012]

*1952*
replace string_PSparties = "Catholic People's Party (29), PVDA (28.7), Anti-Revolutionary Party (11.3), Christian Historical Union (8.9), VVD (8.8)" if countryelection == 240
replace string_CPparties = "Catholic National Party (2.7, Rel), Other (2.1, Oth)" if countryelection == 240
replace string_SCparties = "NA" if countryelection == 240
replace string_ASparties = "Communist (6.2, Com), Reformed Political Party (2.4, Rel)" if countryelection == 240

replace voteper_PSparties = 86.7  if countryelection == 240
replace voteper_CPparties =  4.8 if countryelection == 240
replace voteper_SCparties =  0   if countryelection == 240
replace voteper_ASparties =  8.6 if countryelection == 240

replace voteper_EL_ASP = 6.2    if countryelection == 240
replace voteper_RL_ASP = .       if countryelection == 240
replace voteper_ER_ASP = .        if countryelection == 240
replace voteper_RR_ASP = .      if countryelection == 240
replace voteper_GREEN_ASP = .    if countryelection == 240
replace voteper_PIRATE_ASP = .     if countryelection == 240
replace voteper_MISC_POP_ASP = .  if countryelection == 240
replace voteper_SEC_NAT_ASP = .   if countryelection == 240
replace voteper_REL_ASP = 2.4       if countryelection == 240
replace voteper_OTHERR_ASP = .   if countryelection == 240
replace voteper_OTHERL_ASP = .    if countryelection == 240

*1956*
replace string_PSparties = "Catholic People's Party (31.7), PVDA (32.7), Anti-Revolutionary Party (9.9), Christian Historical Union (8.4), VVD (8.8)" if countryelection == 241
replace string_CPparties = "Other (1.6, Oth)" if countryelection == 241
replace string_SCparties = "NA" if countryelection == 241
replace string_ASparties = "Communist (4.7, Com), Reformed Political Party (2.3, Rel)" if countryelection == 241

replace voteper_PSparties = 91.5  if countryelection == 241
replace voteper_CPparties =  1.6 if countryelection == 241
replace voteper_SCparties =  0   if countryelection == 241
replace voteper_ASparties = 7 if countryelection == 241

replace voteper_EL_ASP = 4.7    if countryelection == 241
replace voteper_RL_ASP = .       if countryelection == 241
replace voteper_ER_ASP = .        if countryelection == 241
replace voteper_RR_ASP = .      if countryelection == 241
replace voteper_GREEN_ASP = .    if countryelection == 241
replace voteper_PIRATE_ASP = .     if countryelection == 241
replace voteper_MISC_POP_ASP = .  if countryelection == 241
replace voteper_SEC_NAT_ASP = .   if countryelection == 241
replace voteper_REL_ASP = 2.3       if countryelection == 241
replace voteper_OTHERR_ASP = .   if countryelection == 241
replace voteper_OTHERL_ASP = .    if countryelection == 241

*1959*
replace string_PSparties = "Catholic People's Party (31.6), PVDA (30.4), Anti-Revolutionary Party (9.4), Christian Historical Union (8.1), VVD (12.2)" if countryelection == 242
replace string_CPparties = "Other (1.3, Oth)" if countryelection == 242
replace string_SCparties = "NA" if countryelection == 242
replace string_ASparties = "Communist (2.4, Com), Reformed Political Party (2.2, Rel), Pacifist Socialist Party (RL, 1.8), Reformed Political League (0.7, Rel)" if countryelection == 242

replace voteper_PSparties = 91.7  if countryelection == 242
replace voteper_CPparties =  1.3 if countryelection == 242
replace voteper_SCparties =  0   if countryelection == 242
replace voteper_ASparties =  7.1 if countryelection == 242

replace voteper_EL_ASP = 2.4    if countryelection == 242
replace voteper_RL_ASP = 1.8       if countryelection == 242
replace voteper_ER_ASP = .        if countryelection == 242
replace voteper_RR_ASP = .      if countryelection == 242
replace voteper_GREEN_ASP = .    if countryelection == 242
replace voteper_PIRATE_ASP = .     if countryelection == 242
replace voteper_MISC_POP_ASP = .  if countryelection == 242
replace voteper_SEC_NAT_ASP = .   if countryelection == 242
replace voteper_REL_ASP = 2.9       if countryelection == 242
replace voteper_OTHERR_ASP = .   if countryelection == 242
replace voteper_OTHERL_ASP = .    if countryelection == 242

*1963*
replace string_PSparties = "Catholic People's Party (31.9), PVDA (28), Anti-Revolutionary Party (8.7), Christian Historical Union (8.6), VVD (10.3)" if countryelection == 243
replace string_CPparties = "Other (1.6, Oth)" if countryelection == 243
replace string_SCparties = "NA" if countryelection == 243
replace string_ASparties = "Communist (2.8, Com), Reformed Political Party (2.3, Rel), Pacifist Socialist Party (RL, 3), Reformed Political League (0.7, Rel), Farmer's Party (2.1, RW/Agr., Populist)" if countryelection == 243

replace voteper_PSparties = 87.5  if countryelection == 243
replace voteper_CPparties =  1.6 if countryelection == 243
replace voteper_SCparties =  0   if countryelection == 243
replace voteper_ASparties = 10.9 if countryelection == 243

replace voteper_EL_ASP = 2.8    if countryelection == 243
replace voteper_RL_ASP = 3       if countryelection == 243
replace voteper_ER_ASP = .        if countryelection == 243
replace voteper_RR_ASP = .      if countryelection == 243
replace voteper_GREEN_ASP = .    if countryelection == 243
replace voteper_PIRATE_ASP = .     if countryelection == 243
replace voteper_MISC_POP_ASP = 2.1  if countryelection == 243
replace voteper_SEC_NAT_ASP = .   if countryelection == 243
replace voteper_REL_ASP = 3     if countryelection == 243
replace voteper_OTHERR_ASP = .   if countryelection == 243
replace voteper_OTHERL_ASP = .    if countryelection == 243

*1967*
replace string_PSparties = "Catholic People's Party (26.5), PVDA (23.6), Anti-Revolutionary Party (9.9), Christian Historical Union (8.1), VVD (10.7)" if countryelection == 244
replace string_CPparties = "Other (2.5, Oth)" if countryelection == 244
replace string_SCparties = "NA" if countryelection == 244
replace string_ASparties = "Communist (3.6, Com), Reformed Political Party (2, Rel), Pacifist Socialist Party (RL, 2.9), Reformed Political League (0.9, Rel), Farmer's Party (4.8, RW/Agr., Populist), D66 (4.5, Lib)" if countryelection == 244

replace voteper_PSparties = 78.8  if countryelection == 244
replace voteper_CPparties =  2.5 if countryelection == 244
replace voteper_SCparties =  0   if countryelection == 244
replace voteper_ASparties = 18.7 if countryelection == 244

replace voteper_EL_ASP = 3.6    if countryelection == 244
replace voteper_RL_ASP = 2.9       if countryelection == 244
replace voteper_ER_ASP = .        if countryelection == 244
replace voteper_RR_ASP = .      if countryelection == 244
replace voteper_GREEN_ASP = .    if countryelection == 244
replace voteper_PIRATE_ASP = .     if countryelection == 244
replace voteper_MISC_POP_ASP = 4.8  if countryelection == 244
replace voteper_SEC_NAT_ASP = .   if countryelection == 244
replace voteper_REL_ASP = 2.9      if countryelection == 244
replace voteper_OTHERR_ASP = .   if countryelection == 244
replace voteper_OTHERL_ASP = 4.5    if countryelection == 244

*1971*
replace string_PSparties = "Catholic People's Party (21.8), PVDA (24.6), Anti-Revolutionary Party (8.6), Christian Historical Union (6.3), VVD (10.3), Radical Party (1.8)" if countryelection == 245
replace string_CPparties = "Other (2.4, Oth), Democratic Socialist (5.3, LW), New Middle Party (1.5, Lib)" if countryelection == 245
replace string_SCparties = "D66 (6.8, Lib)" if countryelection == 245
replace string_ASparties = "Communist (3.9, Com), Reformed Political Party (2.3, Rel), Pacifist Socialist Party (RL, 1.4), Reformed Political League (1.6, Rel), Farmer's Party (1.1, RW/Agr., Populist)" if countryelection == 245

replace voteper_PSparties = 73.5  if countryelection == 245
replace voteper_CPparties =  9.3 if countryelection == 245
replace voteper_SCparties =  6.9   if countryelection == 245
replace voteper_ASparties = 10.3 if countryelection == 245

replace voteper_EL_ASP = 3.9    if countryelection == 245
replace voteper_RL_ASP = 1.4       if countryelection == 245
replace voteper_ER_ASP = .        if countryelection == 245
replace voteper_RR_ASP = .      if countryelection == 245
replace voteper_GREEN_ASP = .    if countryelection == 245
replace voteper_PIRATE_ASP = .     if countryelection == 245
replace voteper_MISC_POP_ASP = 1.1  if countryelection == 245
replace voteper_SEC_NAT_ASP = .   if countryelection == 245
replace voteper_REL_ASP = 3.9       if countryelection == 245
replace voteper_OTHERR_ASP = .   if countryelection == 245
replace voteper_OTHERL_ASP = .    if countryelection == 245

*1972*
replace string_PSparties = "Catholic People's Party (17.7), PVDA (27.3), Anti-Revolutionary Party (8.8), Christian Historical Union (4.8), VVD (14.4), Radical Party (4.8)" if countryelection == 246
replace string_CPparties = "Other (1, Oth), Democratic Socialist (4.1, LW), Roman Catholic People's (0.9, Rel)" if countryelection == 246
replace string_SCparties = "D66 (4.2, Lib)" if countryelection == 246
replace string_ASparties = "Communist (4.5, Com), Reformed Political Party (2.2, Rel), Pacifist Socialist Party (RL, 1.5), Reformed Political League (1.8, Rel), Farmer's Party (1.9, RW/Agr., Populist)" if countryelection == 246

replace voteper_PSparties = 77.8  if countryelection == 246
replace voteper_CPparties =  6    if countryelection == 246
replace voteper_SCparties =  4.2  if countryelection == 246
replace voteper_ASparties = 11.9 if countryelection == 246

replace voteper_EL_ASP = 4.5    if countryelection == 246
replace voteper_RL_ASP = 1.5       if countryelection == 246
replace voteper_ER_ASP = .        if countryelection == 246
replace voteper_RR_ASP = .      if countryelection == 246
replace voteper_GREEN_ASP = .    if countryelection == 246
replace voteper_PIRATE_ASP = .     if countryelection == 246
replace voteper_MISC_POP_ASP = 1.9  if countryelection == 246
replace voteper_SEC_NAT_ASP = .   if countryelection == 246
replace voteper_REL_ASP = 4       if countryelection == 246
replace voteper_OTHERR_ASP = .   if countryelection == 246
replace voteper_OTHERL_ASP = .    if countryelection == 246

*1977*
replace string_PSparties = "Christian Democratic Appeal (31.9), PVDA (33.8), VVD (17.9), Radical Party (1.7)" if countryelection == 247
replace string_CPparties = "Other (1.9, Oth), Democratic Socialist (0.7, LW)" if countryelection == 247
replace string_SCparties = "D66 (5.4, Lib)" if countryelection == 247
replace string_ASparties = "Communist (1.7, Com), Reformed Political Party (2.1, Rel), Pacifist Socialist Party (RL, 0.9), Reformed Political League (1, Rel), Farmer's Party (0.8, RW/Agr., Populist)" if countryelection == 247

replace voteper_PSparties = 85.3  if countryelection == 247
replace voteper_CPparties =  2.7  if countryelection == 247
replace voteper_SCparties =  5.4   if countryelection == 247
replace voteper_ASparties =  6.5  if countryelection == 247

replace voteper_EL_ASP = 1.7    if countryelection == 247
replace voteper_RL_ASP = 0.9       if countryelection == 247
replace voteper_ER_ASP = .        if countryelection == 247
replace voteper_RR_ASP = .      if countryelection == 247
replace voteper_GREEN_ASP = .    if countryelection == 247
replace voteper_PIRATE_ASP = .     if countryelection == 247
replace voteper_MISC_POP_ASP = 0.8  if countryelection == 247
replace voteper_SEC_NAT_ASP = .   if countryelection == 247
replace voteper_REL_ASP = 3.1       if countryelection == 247
replace voteper_OTHERR_ASP = .   if countryelection == 247
replace voteper_OTHERL_ASP = .    if countryelection == 247

*1981*
replace string_PSparties = "Christian Democratic Appeal (30.8), PVDA (28.3), VVD (17.3)" if countryelection == 248
replace string_CPparties = "Other (2.4, Oth)" if countryelection == 248
replace string_SCparties = "D66 (11.1, Lib)" if countryelection == 248
replace string_ASparties = "Radical Party (2, OL), Communist (2.1, Com), Reformed Political Party (2, Rel), Pacifist Socialist Party (RL, 2.1), Reformed Political League (0.8, Rel), Reformed Federation (1.2, Rel)" if countryelection == 248

replace voteper_PSparties = 76.4  if countryelection == 248
replace voteper_CPparties =  2.4 if countryelection == 248
replace voteper_SCparties = 11.1    if countryelection == 248
replace voteper_ASparties = 10.2 if countryelection == 248

replace voteper_EL_ASP = 2.1    if countryelection == 248
replace voteper_RL_ASP = 2.1       if countryelection == 248
replace voteper_ER_ASP = .        if countryelection == 248
replace voteper_RR_ASP = .      if countryelection == 248
replace voteper_GREEN_ASP = .    if countryelection == 248
replace voteper_PIRATE_ASP = .     if countryelection == 248
replace voteper_MISC_POP_ASP = .  if countryelection == 248
replace voteper_SEC_NAT_ASP = .   if countryelection == 248
replace voteper_REL_ASP = 4       if countryelection == 248
replace voteper_OTHERR_ASP = .   if countryelection == 248
replace voteper_OTHERL_ASP = 2    if countryelection == 248

*1982*
replace string_PSparties = "Christian Democratic Appeal (29.4), PVDA (30.4), VVD (23.1)" if countryelection == 249
replace string_CPparties = "Other (1.6, Oth), Evangelical People's (0.2, Rel)" if countryelection == 249
replace string_SCparties = "D66 (4.3, Lib)" if countryelection == 249
replace string_ASparties = "Radical Party (1.7, LW), Communist (1.8, Com), Reformed Political Party (1.9, Rel), Pacifist Socialist Party (RL, 2.3), Reformed Political League (0.8, Rel), Reformed Federation (1.5, Rel), Centre Party (0.8, RR)" if countryelection == 249

replace voteper_PSparties = 82.9  if countryelection == 249
replace voteper_CPparties =  1.8  if countryelection == 249
replace voteper_SCparties =  4.4   if countryelection == 249
replace voteper_ASparties = 10.8 if countryelection == 249

replace voteper_EL_ASP = 1.8    if countryelection == 249
replace voteper_RL_ASP = 2.3       if countryelection == 249
replace voteper_ER_ASP = .        if countryelection == 249
replace voteper_RR_ASP = 0.8      if countryelection == 249
replace voteper_GREEN_ASP = .    if countryelection == 249
replace voteper_PIRATE_ASP = .     if countryelection == 249
replace voteper_MISC_POP_ASP = .  if countryelection == 249
replace voteper_SEC_NAT_ASP = .   if countryelection == 249
replace voteper_REL_ASP = 4.2      if countryelection == 249
replace voteper_OTHERR_ASP = .   if countryelection == 249
replace voteper_OTHERL_ASP = 1.7    if countryelection == 249

*1986*
replace string_PSparties = "Christian Democratic Appeal (34.6), PVDA (33.3), VVD (17.4)" if countryelection == 250
replace string_CPparties = "Other (1.5, Oth)" if countryelection == 250
replace string_SCparties = "D66 (6.1, Lib)" if countryelection == 250
replace string_ASparties = "Radical Party (1.3, LW), Communist (0.6, Com), Reformed Political Party (1.7, Rel), Pacifist Socialist Party (RL, 1.2), Reformed Political League (1, Rel), Reformed Federation (0.9, Rel), Centre Party (0.4, RR)" if countryelection == 250

replace voteper_PSparties = 85.4  if countryelection == 250
replace voteper_CPparties =  1.5  if countryelection == 250
replace voteper_SCparties =  6.1   if countryelection == 250
replace voteper_ASparties =  7.1  if countryelection == 250

replace voteper_EL_ASP = 0.6    if countryelection == 250
replace voteper_RL_ASP = 1.2       if countryelection == 250
replace voteper_ER_ASP = .        if countryelection == 250
replace voteper_RR_ASP = 0.4      if countryelection == 250
replace voteper_GREEN_ASP = .    if countryelection == 250
replace voteper_PIRATE_ASP = .     if countryelection == 250
replace voteper_MISC_POP_ASP = .  if countryelection == 250
replace voteper_SEC_NAT_ASP = .   if countryelection == 250
replace voteper_REL_ASP = 3.6       if countryelection == 250
replace voteper_OTHERR_ASP = .   if countryelection == 250
replace voteper_OTHERL_ASP = 1.3    if countryelection == 250

*1989*
replace string_PSparties = "Christian Democratic Appeal (35.3), PVDA (31.9), VVD (14.6)" if countryelection == 251
replace string_CPparties = "Other (1.3, Oth)" if countryelection == 251
replace string_SCparties = "D66 (7.9, Lib)" if countryelection == 251
replace string_ASparties = "GreenLeft (4.1, Green), Reformed Political Party (1.9, Rel), Reformed Political League (1.2, Rel), Reformed Federation (1, Rel), Centre Party (0.9, RR)" if countryelection == 251

replace voteper_PSparties = 81.8  if countryelection == 251
replace voteper_CPparties =  1.3  if countryelection == 251
replace voteper_SCparties =  7.9  if countryelection == 251
replace voteper_ASparties =  9.1  if countryelection == 251

replace voteper_EL_ASP = .    if countryelection == 251
replace voteper_RL_ASP = .       if countryelection == 251
replace voteper_ER_ASP = .        if countryelection == 251
replace voteper_RR_ASP = 0.9      if countryelection == 251
replace voteper_GREEN_ASP = 4.1    if countryelection == 251
replace voteper_PIRATE_ASP = .     if countryelection == 251
replace voteper_MISC_POP_ASP = .  if countryelection == 251
replace voteper_SEC_NAT_ASP = .   if countryelection == 251
replace voteper_REL_ASP = 4.1       if countryelection == 251
replace voteper_OTHERR_ASP = .   if countryelection == 251
replace voteper_OTHERL_ASP = .    if countryelection == 251

*1994*
replace string_PSparties = "Christian Democratic Appeal (22.2), PVDA (24), VVD (20)" if countryelection == 252
replace string_CPparties = "Other (1.4, Oth), Elderly Alliance (3.6, Pens), Union 55+ (0.9, Pens)" if countryelection == 252
replace string_SCparties = "D66 (15.5, Lib)" if countryelection == 252
replace string_ASparties = "Socialist Party (1.3, RL), GreenLeft (3.5, Green), Reformed Political Party (1.7, Rel), Reformed Political League (1.3, Rel), Reformed Federation (1.8, Rel), Centre Party (2.5, RR), Centre Party 86 (0.4, RR)" if countryelection == 252

replace voteper_PSparties = 66.2  if countryelection == 252
replace voteper_CPparties =  5.9  if countryelection == 252
replace voteper_SCparties = 15.5  if countryelection == 252
replace voteper_ASparties = 12.5  if countryelection == 252

replace voteper_EL_ASP = .    if countryelection == 252
replace voteper_RL_ASP = 1.3       if countryelection == 252
replace voteper_ER_ASP = .        if countryelection == 252
replace voteper_RR_ASP = 2.9      if countryelection == 252
replace voteper_GREEN_ASP = 3.5    if countryelection == 252
replace voteper_PIRATE_ASP = .     if countryelection == 252
replace voteper_MISC_POP_ASP = .  if countryelection == 252
replace voteper_SEC_NAT_ASP = .   if countryelection == 252
replace voteper_REL_ASP = 4.8       if countryelection == 252
replace voteper_OTHERR_ASP = .   if countryelection == 252
replace voteper_OTHERL_ASP = .    if countryelection == 252

*1998*
replace string_PSparties = "Christian Democratic Appeal (18.4), PVDA (29), VVD (24.7)" if countryelection == 253
replace string_CPparties = "Other (2, Oth), Union 55+ (0.5, Pens)" if countryelection == 253
replace string_SCparties = "D66 (9, Lib)" if countryelection == 253
replace string_ASparties = "Socialist Party (3.5, RL), GreenLeft (7.3, Green), Reformed Political Party (1.8, Rel), Reformed Political League (1.3, Rel), Reformed Federation (2, Rel), Centre Party (0.6, RR)" if countryelection == 253

replace voteper_PSparties = 72.1  if countryelection == 253
replace voteper_CPparties =  2.5  if countryelection == 253
replace voteper_SCparties =  9.0  if countryelection == 253
replace voteper_ASparties = 16.5  if countryelection == 253

replace voteper_EL_ASP = .    if countryelection == 253
replace voteper_RL_ASP = 3.5       if countryelection == 253
replace voteper_ER_ASP = .        if countryelection == 253
replace voteper_RR_ASP = 0.6      if countryelection == 253
replace voteper_GREEN_ASP = 7.3    if countryelection == 253
replace voteper_PIRATE_ASP = .     if countryelection == 253
replace voteper_MISC_POP_ASP = .  if countryelection == 253
replace voteper_SEC_NAT_ASP = .   if countryelection == 253
replace voteper_REL_ASP = 5.1       if countryelection == 253
replace voteper_OTHERR_ASP = .   if countryelection == 253
replace voteper_OTHERL_ASP = .    if countryelection == 253

*2002*
replace string_PSparties = "Christian Democratic Appeal (27.9), PVDA (15.1), VVD (15.4)" if countryelection == 254
replace string_CPparties = "Other (0.7, Oth), Christian Union (2.5, Rel)" if countryelection == 254
replace string_SCparties = "D66 (5.1, Lib)" if countryelection == 254
replace string_ASparties = "Pim Fortuyn List (17, RR), Socialist Party (5.9, RL), GreenLeft (7, Green), Livable Netherlands (MISC_POP, 1.6), Reformed Political Party (1.7, Rel)" if countryelection == 254

replace voteper_PSparties = 58.4  if countryelection == 254
replace voteper_CPparties =  3.2  if countryelection == 254
replace voteper_SCparties =  5.1   if countryelection == 254
replace voteper_ASparties = 33.2 if countryelection == 254

replace voteper_EL_ASP = .    if countryelection == 254
replace voteper_RL_ASP = 5.9       if countryelection == 254
replace voteper_ER_ASP = .        if countryelection == 254
replace voteper_RR_ASP = 17      if countryelection == 254
replace voteper_GREEN_ASP = 7    if countryelection == 254
replace voteper_PIRATE_ASP = .     if countryelection == 254
replace voteper_MISC_POP_ASP = 1.6  if countryelection == 254
replace voteper_SEC_NAT_ASP = .   if countryelection == 254
replace voteper_REL_ASP = 1.7      if countryelection == 254
replace voteper_OTHERR_ASP = .   if countryelection == 254
replace voteper_OTHERL_ASP = .    if countryelection == 254

*2003*
replace string_PSparties = "Christian Democratic Appeal (28.6), PVDA (27.2), VVD (17.9)" if countryelection == 255
replace string_CPparties = "Other (0.8, Oth), Christian Union (2.1, Rel), GreenLeft (5.1, Green), Party for the Animals (0.5, Green)" if countryelection == 255
replace string_SCparties = "D66 (4, Lib), Pim Fortuyn List (5.6, RR)" if countryelection == 255
replace string_ASparties = "Socialist Party (6.3, RL), Livable Netherlands (MISC_POP, 0.4), Reformed Political Party (1.5, Rel)" if countryelection == 255

replace voteper_PSparties = 73.7 if countryelection == 255
replace voteper_CPparties =  8.5 if countryelection == 255
replace voteper_SCparties = 10.6 if countryelection == 255
replace voteper_ASparties =  8.2 if countryelection == 255

replace voteper_EL_ASP = .    if countryelection == 255
replace voteper_RL_ASP = 6.3       if countryelection == 255
replace voteper_ER_ASP = .        if countryelection == 255
replace voteper_RR_ASP = .      if countryelection == 255
replace voteper_GREEN_ASP = .    if countryelection == 255
replace voteper_PIRATE_ASP = .     if countryelection == 255
replace voteper_MISC_POP_ASP = 0.4  if countryelection == 255
replace voteper_SEC_NAT_ASP = .   if countryelection == 255
replace voteper_REL_ASP = 1.5       if countryelection == 255
replace voteper_OTHERR_ASP = .   if countryelection == 255
replace voteper_OTHERL_ASP = .    if countryelection == 255

*2006*
replace string_PSparties = "Christian Democratic Appeal (26.5), PVDA (21.2), VVD (14.7)" if countryelection == 256
replace string_CPparties = "Other (0.4, Oth), Christian Union (4, Rel), GreenLeft (4.6, Green), Party for the Animals (1.8, Green)" if countryelection == 256
replace string_SCparties = "D66 (2, Lib)" if countryelection == 256
replace string_ASparties = "Party for Freedom (5.9, RR), One NL (0.6, RR), Socialist Party (16.6, RL), Reformed Political Party (1.6, Rel)" if countryelection == 256

replace voteper_PSparties = 62.4   if countryelection == 256
replace voteper_CPparties = 10.8 if countryelection == 256
replace voteper_SCparties =  2   if countryelection == 256
replace voteper_ASparties = 24.7 if countryelection == 256

replace voteper_EL_ASP = .    if countryelection == 256
replace voteper_RL_ASP = 16.6       if countryelection == 256
replace voteper_ER_ASP = .        if countryelection == 256
replace voteper_RR_ASP = 6.5      if countryelection == 256
replace voteper_GREEN_ASP = .    if countryelection == 256
replace voteper_PIRATE_ASP = .     if countryelection == 256
replace voteper_MISC_POP_ASP = .  if countryelection == 256
replace voteper_SEC_NAT_ASP = .   if countryelection == 256
replace voteper_REL_ASP = 1.6       if countryelection == 256
replace voteper_OTHERR_ASP = .   if countryelection == 256
replace voteper_OTHERL_ASP = .    if countryelection == 256

*2010*
replace string_PSparties = "Christian Democratic Appeal (13.6), PVDA (19.6), VVD (20.5), Christian Union (3.2)" if countryelection == 257
replace string_CPparties = "Other (0.5, Oth), GreenLeft (6.7, Green), Party for the Animals (1.3, Green), Proud of the Netherlands (0.6, Con)" if countryelection == 257
replace string_SCparties = "D66 (7, Lib)" if countryelection == 257
replace string_ASparties = "Party for Freedom (15.5, RR), Socialist Party (9.8, RL), Reformed Political Party (1.7, Rel)" if countryelection == 257

replace voteper_PSparties = 56.9  if countryelection == 257
replace voteper_CPparties =  9.1 if countryelection == 257
replace voteper_SCparties =  7   if countryelection == 257
replace voteper_ASparties = 27 if countryelection == 257

replace voteper_EL_ASP = .    if countryelection == 257
replace voteper_RL_ASP = 9.8       if countryelection == 257
replace voteper_ER_ASP = .        if countryelection == 257
replace voteper_RR_ASP = 15.5      if countryelection == 257
replace voteper_GREEN_ASP = .    if countryelection == 257
replace voteper_PIRATE_ASP = .     if countryelection == 257
replace voteper_MISC_POP_ASP = .  if countryelection == 257
replace voteper_SEC_NAT_ASP = .   if countryelection == 257
replace voteper_REL_ASP = 1.7       if countryelection == 257
replace voteper_OTHERR_ASP = .   if countryelection == 257
replace voteper_OTHERL_ASP = .    if countryelection == 257

*2012*
replace string_PSparties = "Christian Democratic Appeal (8.5), PVDA (24.8), VVD (26.6), Christian Union (3.1)" if countryelection == 258
replace string_CPparties = "Other (0.8, Oth), GreenLeft (2.3, Green), 50+ Party (1.9, Pens), Party for the Animals (1.9, Green)" if countryelection == 258
replace string_SCparties = "D66 (8, Lib)" if countryelection == 258
replace string_ASparties = "Party for Freedom (10.1, RR), Socialist Party (9.7, RL), Reformed Political Party (2.1, Rel)" if countryelection == 258

replace voteper_PSparties = 63  if countryelection == 258
replace voteper_CPparties = 7.1 if countryelection == 258
replace voteper_SCparties = 8.0    if countryelection == 258
replace voteper_ASparties = 21.9 if countryelection == 258

replace voteper_EL_ASP = .    if countryelection == 258
replace voteper_RL_ASP = 9.7       if countryelection == 258
replace voteper_ER_ASP = .        if countryelection == 258
replace voteper_RR_ASP = 10.1      if countryelection == 258
replace voteper_GREEN_ASP = .    if countryelection == 258
replace voteper_PIRATE_ASP = .     if countryelection == 258
replace voteper_MISC_POP_ASP = .  if countryelection == 258
replace voteper_SEC_NAT_ASP = .   if countryelection == 258
replace voteper_REL_ASP = 2.1      if countryelection == 258
replace voteper_OTHERR_ASP = .   if countryelection == 258
replace voteper_OTHERL_ASP = .    if countryelection == 258



******************************************************* NEW ZEALAND ***********************************************************

***** Source:  Nohlen and Hartmann (2001) [1951-1999]
*              Te Kaitiaki Take Kowhirl - NZ Electoral Commission Website [2002-2014]

*1951*
replace string_PSparties = "Labour (45.9), National (53.9)" if countryelection == 259
replace string_CPparties = "Other (0.2, Oth)" if countryelection == 259
replace string_SCparties = "NA" if countryelection == 259
replace string_ASparties = "NA" if countryelection == 259

replace voteper_PSparties = 99.8  if countryelection == 259
replace voteper_CPparties = 0.2  if countryelection == 259
replace voteper_SCparties = 0  if countryelection == 259
replace voteper_ASparties = 0  if countryelection == 259

replace voteper_EL_ASP = .    if countryelection == 259
replace voteper_RL_ASP = .       if countryelection == 259
replace voteper_ER_ASP = .        if countryelection == 259
replace voteper_RR_ASP = .      if countryelection == 259
replace voteper_GREEN_ASP = .    if countryelection == 259
replace voteper_PIRATE_ASP = .     if countryelection == 259
replace voteper_MISC_POP_ASP = .  if countryelection == 259
replace voteper_SEC_NAT_ASP = .   if countryelection == 259
replace voteper_REL_ASP = .      if countryelection == 259
replace voteper_OTHERR_ASP = .   if countryelection == 259
replace voteper_OTHERL_ASP = .    if countryelection == 259

*1954*
replace string_PSparties = "Labour (44.1), National (44.3)" if countryelection == 260
replace string_CPparties = "Other (0.3, Oth)" if countryelection == 260
replace string_SCparties = "NA" if countryelection == 260
replace string_ASparties = "Communist (0.1, EL), Social Credit (11.2, OL)" if countryelection == 260

replace voteper_PSparties = 88.4  if countryelection == 260
replace voteper_CPparties =  0.3  if countryelection == 260
replace voteper_SCparties =  0    if countryelection == 260
replace voteper_ASparties = 11.3  if countryelection == 260

replace voteper_EL_ASP = 0.1    if countryelection == 260
replace voteper_RL_ASP = .       if countryelection == 260
replace voteper_ER_ASP = .        if countryelection == 260
replace voteper_RR_ASP = .      if countryelection == 260
replace voteper_GREEN_ASP = .    if countryelection == 260
replace voteper_PIRATE_ASP = .     if countryelection == 260
replace voteper_MISC_POP_ASP = .  if countryelection == 260
replace voteper_SEC_NAT_ASP = .   if countryelection == 260
replace voteper_REL_ASP = .      if countryelection == 260
replace voteper_OTHERR_ASP = .   if countryelection == 260
replace voteper_OTHERL_ASP = 11.2    if countryelection == 260

*1957*
replace string_PSparties = "Labour (48.3), National (44.2)" if countryelection == 261
replace string_CPparties = "Other (0.3, Oth)" if countryelection == 261
replace string_SCparties = "NA" if countryelection == 261
replace string_ASparties = "Social Credit (7.2, OL)" if countryelection == 261

replace voteper_PSparties = 92.5  if countryelection == 261
replace voteper_CPparties =  0.3  if countryelection == 261
replace voteper_SCparties =  0    if countryelection == 261
replace voteper_ASparties =  7.2  if countryelection == 261

replace voteper_EL_ASP = .    if countryelection == 261
replace voteper_RL_ASP = .       if countryelection == 261
replace voteper_ER_ASP = .        if countryelection == 261
replace voteper_RR_ASP = .      if countryelection == 261
replace voteper_GREEN_ASP = .    if countryelection == 261
replace voteper_PIRATE_ASP = .     if countryelection == 261
replace voteper_MISC_POP_ASP = .  if countryelection == 261
replace voteper_SEC_NAT_ASP = .   if countryelection == 261
replace voteper_REL_ASP = .      if countryelection == 261
replace voteper_OTHERR_ASP = .   if countryelection == 261
replace voteper_OTHERL_ASP = 7.2    if countryelection == 261

*1960*
replace string_PSparties = "Labour (43.4), National (47.6)" if countryelection == 262
replace string_CPparties = "Other (0.2, Oth)" if countryelection == 262
replace string_SCparties = "NA" if countryelection == 262
replace string_ASparties = "Communist (0.2, EL), Social Credit (8.6, OL)" if countryelection == 262

replace voteper_PSparties = 91  if countryelection == 262
replace voteper_CPparties = 0.2 if countryelection == 262
replace voteper_SCparties = 0  if countryelection == 262
replace voteper_ASparties = 8.8  if countryelection == 262

replace voteper_EL_ASP = 0.2    if countryelection == 262
replace voteper_RL_ASP = .       if countryelection == 262
replace voteper_ER_ASP = .        if countryelection == 262
replace voteper_RR_ASP = .      if countryelection == 262
replace voteper_GREEN_ASP = .    if countryelection == 262
replace voteper_PIRATE_ASP = .     if countryelection == 262
replace voteper_MISC_POP_ASP = .  if countryelection == 262
replace voteper_SEC_NAT_ASP = .   if countryelection == 262
replace voteper_REL_ASP = .      if countryelection == 262
replace voteper_OTHERR_ASP = .   if countryelection == 262
replace voteper_OTHERL_ASP = 8.6    if countryelection == 262

*1963*
replace string_PSparties = "Labour (43.7), National (47.1)" if countryelection == 263
replace string_CPparties = "Other (0.1, Oth), Liberal (0.9, Lib)" if countryelection == 263
replace string_SCparties = "NA" if countryelection == 263
replace string_ASparties = "Communist (0.3, EL), Social Credit (7.9, OL)" if countryelection == 263

replace voteper_PSparties = 90.8 if countryelection == 263
replace voteper_CPparties =  1.0 if countryelection == 263
replace voteper_SCparties =  0   if countryelection == 263
replace voteper_ASparties =  8.2 if countryelection == 263

replace voteper_EL_ASP = 0.3    if countryelection == 263
replace voteper_RL_ASP = .       if countryelection == 263
replace voteper_ER_ASP = .        if countryelection == 263
replace voteper_RR_ASP = .      if countryelection == 263
replace voteper_GREEN_ASP = .    if countryelection == 263
replace voteper_PIRATE_ASP = .     if countryelection == 263
replace voteper_MISC_POP_ASP = .  if countryelection == 263
replace voteper_SEC_NAT_ASP = .   if countryelection == 263
replace voteper_REL_ASP = .      if countryelection == 263
replace voteper_OTHERR_ASP = .   if countryelection == 263
replace voteper_OTHERL_ASP = 7.9    if countryelection == 263

*1966*
replace string_PSparties = "Labour (41.4), National (43.6)" if countryelection == 264
replace string_CPparties = "Other (0.1, Oth)" if countryelection == 264
replace string_SCparties = "NA" if countryelection == 264
replace string_ASparties = "Communist (0.3, EL), Social Credit (14.5, OL)" if countryelection == 264

replace voteper_PSparties = 85    if countryelection == 264
replace voteper_CPparties =  0.1  if countryelection == 264
replace voteper_SCparties =  0    if countryelection == 264
replace voteper_ASparties = 14.8  if countryelection == 264

replace voteper_EL_ASP = 0.3    if countryelection == 264
replace voteper_RL_ASP = .       if countryelection == 264
replace voteper_ER_ASP = .        if countryelection == 264
replace voteper_RR_ASP = .      if countryelection == 264
replace voteper_GREEN_ASP = .    if countryelection == 264
replace voteper_PIRATE_ASP = .     if countryelection == 264
replace voteper_MISC_POP_ASP = .  if countryelection == 264
replace voteper_SEC_NAT_ASP = .   if countryelection == 264
replace voteper_REL_ASP = .      if countryelection == 264
replace voteper_OTHERR_ASP = .   if countryelection == 264
replace voteper_OTHERL_ASP = 14.5    if countryelection == 264

*1969*
replace string_PSparties = "Labour (44.2), National (45.2)" if countryelection == 265
replace string_CPparties = "Other (1.1, Oth)" if countryelection == 265
replace string_SCparties = "NA" if countryelection == 265
replace string_ASparties = "Social Credit (9.1, OL)" if countryelection == 265

replace voteper_PSparties = 89.7  if countryelection == 265
replace voteper_CPparties =  1.1  if countryelection == 265
replace voteper_SCparties =  0    if countryelection == 265
replace voteper_ASparties =  9.1  if countryelection == 265

replace voteper_EL_ASP = .    if countryelection == 265
replace voteper_RL_ASP = .       if countryelection == 265
replace voteper_ER_ASP = .        if countryelection == 265
replace voteper_RR_ASP = .      if countryelection == 265
replace voteper_GREEN_ASP = .    if countryelection == 265
replace voteper_PIRATE_ASP = .     if countryelection == 265
replace voteper_MISC_POP_ASP = .  if countryelection == 265
replace voteper_SEC_NAT_ASP = .   if countryelection == 265
replace voteper_REL_ASP = .      if countryelection == 265
replace voteper_OTHERR_ASP = .   if countryelection == 265
replace voteper_OTHERL_ASP = 9.1    if countryelection == 265

*1972*
replace string_PSparties = "Labour (48.4), National (41.5)" if countryelection == 266
replace string_CPparties = "Other (0.9, Oth)" if countryelection == 266
replace string_SCparties = "NA" if countryelection == 266
replace string_ASparties = "Social Credit (6.7, OL), Values Party (2, GP), New Democratic Party (0.6, OL)" if countryelection == 266

replace voteper_PSparties = 89.9  if countryelection == 266
replace voteper_CPparties =  0.9  if countryelection == 266
replace voteper_SCparties =  0    if countryelection == 266
replace voteper_ASparties =  9.3  if countryelection == 266

replace voteper_EL_ASP = .    if countryelection == 266
replace voteper_RL_ASP = .       if countryelection == 266
replace voteper_ER_ASP = .        if countryelection == 266
replace voteper_RR_ASP = .      if countryelection == 266
replace voteper_GREEN_ASP = 2    if countryelection == 266
replace voteper_PIRATE_ASP = .     if countryelection == 266
replace voteper_MISC_POP_ASP = .  if countryelection == 266
replace voteper_SEC_NAT_ASP = .   if countryelection == 266
replace voteper_REL_ASP = .      if countryelection == 266
replace voteper_OTHERR_ASP = .   if countryelection == 266
replace voteper_OTHERL_ASP = 7.3    if countryelection == 266

*1975*
replace string_PSparties = "Labour (39.6), National (47.6)" if countryelection == 267
replace string_CPparties = "Other (0.2, Oth)" if countryelection == 267
replace string_SCparties = "NA" if countryelection == 267
replace string_ASparties = "Social Credit (7.4, OL), Values Party (5.2, GP)" if countryelection == 267

replace voteper_PSparties = 87.2  if countryelection == 267
replace voteper_CPparties =  0.2  if countryelection == 267
replace voteper_SCparties =  0    if countryelection == 267
replace voteper_ASparties = 12.6  if countryelection == 267

replace voteper_EL_ASP = .    if countryelection == 267
replace voteper_RL_ASP = .       if countryelection == 267
replace voteper_ER_ASP = .        if countryelection == 267
replace voteper_RR_ASP = .      if countryelection == 267
replace voteper_GREEN_ASP = 5.2    if countryelection == 267
replace voteper_PIRATE_ASP = .     if countryelection == 267
replace voteper_MISC_POP_ASP = .  if countryelection == 267
replace voteper_SEC_NAT_ASP = .   if countryelection == 267
replace voteper_REL_ASP = .      if countryelection == 267
replace voteper_OTHERR_ASP = .   if countryelection == 267
replace voteper_OTHERL_ASP = 7.4    if countryelection == 267

*1978*
replace string_PSparties = "Labour (40.4), National (39.8)" if countryelection == 268
replace string_CPparties = "Other (1.3, Oth)" if countryelection == 268
replace string_SCparties = "NA" if countryelection == 268
replace string_ASparties = "Social Credit (16.1, OL), Values Party (2.4, GP)" if countryelection == 268

replace voteper_PSparties = 80.2  if countryelection == 268
replace voteper_CPparties =  1.3  if countryelection == 268
replace voteper_SCparties =  0    if countryelection == 268
replace voteper_ASparties = 18.5  if countryelection == 268

replace voteper_EL_ASP = .    if countryelection == 268
replace voteper_RL_ASP = .       if countryelection == 268
replace voteper_ER_ASP = .        if countryelection == 268
replace voteper_RR_ASP = .      if countryelection == 268
replace voteper_GREEN_ASP = 2.4    if countryelection == 268
replace voteper_PIRATE_ASP = .     if countryelection == 268
replace voteper_MISC_POP_ASP = .  if countryelection == 268
replace voteper_SEC_NAT_ASP = .   if countryelection == 268
replace voteper_REL_ASP = .      if countryelection == 268
replace voteper_OTHERR_ASP = .   if countryelection == 268
replace voteper_OTHERL_ASP = 16.1    if countryelection == 268

*1981*
replace string_PSparties = "Labour (39), National (38.9)" if countryelection == 269
replace string_CPparties = "Other (0.8, Oth), Mana Motuhake (0.5, Min)" if countryelection == 269
replace string_SCparties = "NA" if countryelection == 269
replace string_ASparties = "Social Credit (20.7, OL), Values Party (0.2, GP)" if countryelection == 269

replace voteper_PSparties = 77.9  if countryelection == 269
replace voteper_CPparties =  1.3  if countryelection == 269
replace voteper_SCparties =  0    if countryelection == 269
replace voteper_ASparties = 20.9  if countryelection == 269

replace voteper_EL_ASP = .    if countryelection == 269
replace voteper_RL_ASP = .       if countryelection == 269
replace voteper_ER_ASP = .        if countryelection == 269
replace voteper_RR_ASP = .      if countryelection == 269
replace voteper_GREEN_ASP = 0.2    if countryelection == 269
replace voteper_PIRATE_ASP = .     if countryelection == 269
replace voteper_MISC_POP_ASP = .  if countryelection == 269
replace voteper_SEC_NAT_ASP = .   if countryelection == 269
replace voteper_REL_ASP = .      if countryelection == 269
replace voteper_OTHERR_ASP = .   if countryelection == 269
replace voteper_OTHERL_ASP = 20.7    if countryelection == 269

*1984*
replace string_PSparties = "Labour (43), National (35.9)" if countryelection == 270
replace string_CPparties = "Other (0.7, Oth), Mana Motuhake (0.3, Min), NZ Party (12.3, RW)" if countryelection == 270
replace string_SCparties = "NA" if countryelection == 270
replace string_ASparties = "Social Credit (7.6, OL), Values Party (0.2, GP)" if countryelection == 270

replace voteper_PSparties = 78.9  if countryelection == 270
replace voteper_CPparties = 13.3  if countryelection == 270
replace voteper_SCparties = 0     if countryelection == 270
replace voteper_ASparties =  7.8  if countryelection == 270

replace voteper_EL_ASP = .    if countryelection == 270
replace voteper_RL_ASP = .       if countryelection == 270
replace voteper_ER_ASP = .        if countryelection == 270
replace voteper_RR_ASP = .      if countryelection == 270
replace voteper_GREEN_ASP = 0.2    if countryelection == 270
replace voteper_PIRATE_ASP = .     if countryelection == 270
replace voteper_MISC_POP_ASP = .  if countryelection == 270
replace voteper_SEC_NAT_ASP = .   if countryelection == 270
replace voteper_REL_ASP = .      if countryelection == 270
replace voteper_OTHERR_ASP = .   if countryelection == 270
replace voteper_OTHERL_ASP = 7.6    if countryelection == 270

*1987*
replace string_PSparties = "Labour (48), National (44)" if countryelection == 271
replace string_CPparties = "Other (1.4, Oth), Mana Motuhake (0.5, Min), NZ Party (0.3, RW)" if countryelection == 271
replace string_SCparties = "NA" if countryelection == 271
replace string_ASparties = "Social Credit (5.7, OL), Values Party (0.1, GP)" if countryelection == 271

replace voteper_PSparties = 92   if countryelection == 271
replace voteper_CPparties =  2.2 if countryelection == 271
replace voteper_SCparties =  0   if countryelection == 271
replace voteper_ASparties =  5.8 if countryelection == 271

replace voteper_EL_ASP = .    if countryelection == 271
replace voteper_RL_ASP = .       if countryelection == 271
replace voteper_ER_ASP = .        if countryelection == 271
replace voteper_RR_ASP = .      if countryelection == 271
replace voteper_GREEN_ASP = 0.1    if countryelection == 271
replace voteper_PIRATE_ASP = .     if countryelection == 271
replace voteper_MISC_POP_ASP = .  if countryelection == 271
replace voteper_SEC_NAT_ASP = .   if countryelection == 271
replace voteper_REL_ASP = .      if countryelection == 271
replace voteper_OTHERR_ASP = .   if countryelection == 271
replace voteper_OTHERL_ASP = 5.7    if countryelection == 271

*1990*
replace string_PSparties = "Labour (35.1), National (47.8)" if countryelection == 272
replace string_CPparties = "Other (1.7, Oth), Mana Motuhake (0.6, Min), New Labour (5.2, LW), Christian Heritage (0.5, Rel)" if countryelection == 272
replace string_SCparties = "NA" if countryelection == 272
replace string_ASparties = "Social Credit (1.7, OL), Green (6.8, GP), Serious Party (0.6, OL)" if countryelection == 272

replace voteper_PSparties = 82.9  if countryelection == 272
replace voteper_CPparties =  8.0  if countryelection == 272
replace voteper_SCparties =  0    if countryelection == 272
replace voteper_ASparties =  9.1  if countryelection == 272

replace voteper_EL_ASP = .    if countryelection == 272
replace voteper_RL_ASP = .       if countryelection == 272
replace voteper_ER_ASP = .        if countryelection == 272
replace voteper_RR_ASP = .      if countryelection == 272
replace voteper_GREEN_ASP = 6.8    if countryelection == 272
replace voteper_PIRATE_ASP = .     if countryelection == 272
replace voteper_MISC_POP_ASP = .  if countryelection == 272
replace voteper_SEC_NAT_ASP = .   if countryelection == 272
replace voteper_REL_ASP = .      if countryelection == 272
replace voteper_OTHERR_ASP = .   if countryelection == 272
replace voteper_OTHERL_ASP = 2.3    if countryelection == 272

*1993*
replace string_PSparties = "Labour (35), National (34.7)" if countryelection == 273
replace string_CPparties = "Other (0.6, Oth), Mana Maori (0.2, Min),  Christian Heritage (2, Rel)" if countryelection == 273
replace string_SCparties = "NA" if countryelection == 273
replace string_ASparties = "Alliance (14.6, OL), Green (3.6, Green), NZ First (8.4, RR), Serious Party (0.6, OL), Natural Law (0.3, Rel)" if countryelection == 273

replace voteper_PSparties = 69.7  if countryelection == 273
replace voteper_CPparties =  2.8  if countryelection == 273
replace voteper_SCparties =  0    if countryelection == 273
replace voteper_ASparties = 27.5  if countryelection == 273

replace voteper_EL_ASP = .    if countryelection == 273
replace voteper_RL_ASP = .       if countryelection == 273
replace voteper_ER_ASP = .        if countryelection == 273
replace voteper_RR_ASP = 8.4      if countryelection == 273
replace voteper_GREEN_ASP = 3.6    if countryelection == 273
replace voteper_PIRATE_ASP = .     if countryelection == 273
replace voteper_MISC_POP_ASP = .  if countryelection == 273
replace voteper_SEC_NAT_ASP = .   if countryelection == 273
replace voteper_REL_ASP = 0.3      if countryelection == 273
replace voteper_OTHERR_ASP = .   if countryelection == 273
replace voteper_OTHERL_ASP = 15.2    if countryelection == 273

*1996*
replace string_PSparties = "Labour (28.2), National (33.8), United NZ (0.9), Christian Coalition (4.3)" if countryelection == 274
replace string_CPparties = "Alliance (8.1, LW), Green (2, Green), Other (1.6, Oth), Legalise Cannabis (1.7, Oth)" if countryelection == 274
replace string_SCparties = "NA" if countryelection == 274
replace string_ASparties = "NZ First (13.3, RR), ACT (6.1, OR)" if countryelection == 274

replace voteper_PSparties = 67.2  if countryelection == 274
replace voteper_CPparties = 13.5  if countryelection == 274
replace voteper_SCparties =  0    if countryelection == 274
replace voteper_ASparties = 19.4  if countryelection == 274

replace voteper_EL_ASP = .    if countryelection == 274
replace voteper_RL_ASP = .       if countryelection == 274
replace voteper_ER_ASP = .        if countryelection == 274
replace voteper_RR_ASP = 13.3      if countryelection == 274
replace voteper_GREEN_ASP = .    if countryelection == 274
replace voteper_PIRATE_ASP = .     if countryelection == 274
replace voteper_MISC_POP_ASP = .  if countryelection == 274
replace voteper_SEC_NAT_ASP = .   if countryelection == 274
replace voteper_REL_ASP = .      if countryelection == 274
replace voteper_OTHERR_ASP = 6.1   if countryelection == 274
replace voteper_OTHERL_ASP = .    if countryelection == 274

*1999*
replace string_PSparties = "Labour (38.7), National (30.5), United NZ (0.5), Christian Coalition (2.4), Maori Pacfic (0.2)" if countryelection == 275
replace string_CPparties = "Alliance (7.7, LW), Green (5.2, Green), Other (0.9, Oth), NZ Future (1.1, Lib), Legalise Cannabis (1.1, Oth)" if countryelection == 275
replace string_SCparties = "NZ First (4.3, RR)" if countryelection == 275
replace string_ASparties = "ACT (7, OR), LibertariaNZ (0.3, OR)" if countryelection == 275

replace voteper_PSparties = 72.3  if countryelection == 275
replace voteper_CPparties = 16.0  if countryelection == 275
replace voteper_SCparties =  4.3  if countryelection == 275
replace voteper_ASparties =  7.3  if countryelection == 275

replace voteper_EL_ASP = .    if countryelection == 275
replace voteper_RL_ASP = .       if countryelection == 275
replace voteper_ER_ASP = .        if countryelection == 275
replace voteper_RR_ASP = .      if countryelection == 275
replace voteper_GREEN_ASP = .    if countryelection == 275
replace voteper_PIRATE_ASP = .     if countryelection == 275
replace voteper_MISC_POP_ASP = .  if countryelection == 275
replace voteper_SEC_NAT_ASP = .   if countryelection == 275
replace voteper_REL_ASP = .      if countryelection == 275
replace voteper_OTHERR_ASP = 7.3   if countryelection == 275
replace voteper_OTHERL_ASP = .    if countryelection == 275

*2002*
replace string_PSparties = "Labour (41.3), National (20.9), Alliance (1.3), Jim Anderson Progressive (1.7), Green (7)" if countryelection == 276
replace string_CPparties = "Other (0.1, Oth), Outdoor Recreation (1.3, Oth), Christian Heritage (1.4, Rel), Mana Maori (0.2, Min), NZ Future (6.7, Lib), Legalise Cannabis (0.6, Oth)" if countryelection == 276
replace string_SCparties = "NZ First (10.4, RR)" if countryelection == 276
replace string_ASparties = "ACT (7.1, OR)" if countryelection == 276

replace voteper_PSparties = 72.2  if countryelection == 276
replace voteper_CPparties = 10.3  if countryelection == 276
replace voteper_SCparties = 10.4  if countryelection == 276
replace voteper_ASparties =  7.1  if countryelection == 276

replace voteper_EL_ASP = .    if countryelection == 276
replace voteper_RL_ASP = .       if countryelection == 276
replace voteper_ER_ASP = .        if countryelection == 276
replace voteper_RR_ASP = .      if countryelection == 276
replace voteper_GREEN_ASP = .    if countryelection == 276
replace voteper_PIRATE_ASP = .     if countryelection == 276
replace voteper_MISC_POP_ASP = .  if countryelection == 276
replace voteper_SEC_NAT_ASP = .   if countryelection == 276
replace voteper_REL_ASP = .      if countryelection == 276
replace voteper_OTHERR_ASP = 7.1   if countryelection == 276
replace voteper_OTHERL_ASP = .    if countryelection == 276

*2005*
replace string_PSparties = "Labour (41.1), National (39.1), Alliance (0.1), Jim Anderson Progressive (1.2), Green (5.3), Maori Party (2.1), NZ Future (2.7)" if countryelection == 277
replace string_CPparties = "Other (0.4, Oth), Destiny NZ (0.6, Rel), Legalise Cannabis (0.3, Oth)" if countryelection == 277
replace string_SCparties = "NZ First (5.7, RR)" if countryelection == 277
replace string_ASparties = "ACT (1.5, OR)" if countryelection == 277

replace voteper_PSparties = 91.6 if countryelection == 277
replace voteper_CPparties =  1.3 if countryelection == 277
replace voteper_SCparties =  5.7 if countryelection == 277
replace voteper_ASparties =  1.5 if countryelection == 277

replace voteper_EL_ASP = .    if countryelection == 277
replace voteper_RL_ASP = .       if countryelection == 277
replace voteper_ER_ASP = .        if countryelection == 277
replace voteper_RR_ASP = .      if countryelection == 277
replace voteper_GREEN_ASP = .    if countryelection == 277
replace voteper_PIRATE_ASP = .     if countryelection == 277
replace voteper_MISC_POP_ASP = .  if countryelection == 277
replace voteper_SEC_NAT_ASP = .   if countryelection == 277
replace voteper_REL_ASP = .      if countryelection == 277
replace voteper_OTHERR_ASP = 1.5   if countryelection == 277
replace voteper_OTHERL_ASP = .    if countryelection == 277

*2008*
replace string_PSparties = "Labour (34), National (44.9), Jim Anderson Progressive (0.9), Green (6.7), Maori Party (2.4), NZ Future (0.9)" if countryelection == 278
replace string_CPparties = "Other (1, Oth), Legalise Cannabis (0.4, Oth)" if countryelection == 278
replace string_SCparties = "NZ First (4.1, RR)" if countryelection == 278
replace string_ASparties = "ACT (3.7, OR), Kiwi Party (0.5, OR), Bill and Ben (0.6, OL)" if countryelection == 278

replace voteper_PSparties = 89.8  if countryelection == 278
replace voteper_CPparties =  1.4 if countryelection == 278
replace voteper_SCparties =  4.1 if countryelection == 278
replace voteper_ASparties =  4.8 if countryelection == 278

replace voteper_EL_ASP = .    if countryelection == 278
replace voteper_RL_ASP = .       if countryelection == 278
replace voteper_ER_ASP = .        if countryelection == 278
replace voteper_RR_ASP = .      if countryelection == 278
replace voteper_GREEN_ASP = .    if countryelection == 278
replace voteper_PIRATE_ASP = .     if countryelection == 278
replace voteper_MISC_POP_ASP = .  if countryelection == 278
replace voteper_SEC_NAT_ASP = .   if countryelection == 278
replace voteper_REL_ASP = .      if countryelection == 278
replace voteper_OTHERR_ASP = 4.2   if countryelection == 278
replace voteper_OTHERL_ASP = 0.6    if countryelection == 278

*2011*
replace string_PSparties = "Labour (27.5), National (47.3), Green (11.1), Maori Party (1.4), NZ Future (0.6)" if countryelection == 279
replace string_CPparties = "Other (0.2, Oth), Legalise Cannabis (0.5, Oth)" if countryelection == 279
replace string_SCparties = "NZ First (6.6, RR), ACT (1.1, Libertarian), " if countryelection == 279
replace string_ASparties = "Mana Movement (RL, 1.1), Conservative Party (2.7, OR)" if countryelection == 279

replace voteper_PSparties = 87.9  if countryelection == 279
replace voteper_CPparties =  0.7  if countryelection == 279
replace voteper_SCparties =  7.7  if countryelection == 279
replace voteper_ASparties =  3.8  if countryelection == 279

replace voteper_EL_ASP = .    if countryelection == 279
replace voteper_RL_ASP = 1.1       if countryelection == 279
replace voteper_ER_ASP = .        if countryelection == 279
replace voteper_RR_ASP = .      if countryelection == 279
replace voteper_GREEN_ASP = .    if countryelection == 279
replace voteper_PIRATE_ASP = .     if countryelection == 279
replace voteper_MISC_POP_ASP = .  if countryelection == 279
replace voteper_SEC_NAT_ASP = .   if countryelection == 279
replace voteper_REL_ASP = .      if countryelection == 279
replace voteper_OTHERR_ASP = 2.7   if countryelection == 279
replace voteper_OTHERL_ASP = .    if countryelection == 279

*2014*
replace string_PSparties = "Labour (25.1), National (47), Green (10.7), Maori Party (1.3), NZ Future (0.2)" if countryelection == 280
replace string_CPparties = "Other (0.4, Oth), Legalise Cannabis (0.5, Oth)" if countryelection == 280
replace string_SCparties = "NZ First (8.7, RR), ACT (0.7, Libertarian), " if countryelection == 280
replace string_ASparties = "Mana Movement (RL, 1.4), Conservative Party (4, OR)" if countryelection == 280

replace voteper_PSparties = 84.3  if countryelection == 280
replace voteper_CPparties =  0.9  if countryelection == 280
replace voteper_SCparties =  9.4  if countryelection == 280
replace voteper_ASparties =  5.4  if countryelection == 280

replace voteper_EL_ASP = .    if countryelection == 280
replace voteper_RL_ASP = 1.4       if countryelection == 280
replace voteper_ER_ASP = .        if countryelection == 280
replace voteper_RR_ASP = .      if countryelection == 280
replace voteper_GREEN_ASP = .    if countryelection == 280
replace voteper_PIRATE_ASP = .     if countryelection == 280
replace voteper_MISC_POP_ASP = .  if countryelection == 280
replace voteper_SEC_NAT_ASP = .   if countryelection == 280
replace voteper_REL_ASP = .      if countryelection == 280
replace voteper_OTHERR_ASP = 4   if countryelection == 280
replace voteper_OTHERL_ASP = .    if countryelection == 280


************************************************ NORWAY **********************************************

***** Source:  Nohlen (2010) [1953-2005]
*              Vagdirektoratet - Norwegian Directorate of Elections Website [2009 - 2013]


*1953*
replace string_PSparties = "Labour (46.7), Conservative (18.8), Liberal (10), Farmer (9)" if countryelection == 281
replace string_CPparties = "Christian Democrat (10.5, Con)" if countryelection == 281
replace string_SCparties = "NA" if countryelection == 281
replace string_ASparties = "Communist (5.1, EL)" if countryelection == 281

replace voteper_PSparties = 84.5  if countryelection == 281
replace voteper_CPparties = 10.5  if countryelection == 281
replace voteper_SCparties =  0    if countryelection == 281
replace voteper_ASparties =  5.1  if countryelection == 281

replace voteper_EL_ASP = 5.1    if countryelection == 281
replace voteper_RL_ASP = .       if countryelection == 281
replace voteper_ER_ASP = .        if countryelection == 281
replace voteper_RR_ASP = .      if countryelection == 281
replace voteper_GREEN_ASP = .    if countryelection == 281
replace voteper_PIRATE_ASP = .     if countryelection == 281
replace voteper_MISC_POP_ASP = .  if countryelection == 281
replace voteper_SEC_NAT_ASP = .   if countryelection == 281
replace voteper_REL_ASP = .      if countryelection == 281
replace voteper_OTHERR_ASP = .   if countryelection == 281
replace voteper_OTHERL_ASP = .    if countryelection == 281

*1957*
replace string_PSparties = "Labour (48.3), Conservative (18.9), Liberal (9.7), Farmer (9.3)" if countryelection == 282
replace string_CPparties = "Christian Democrat (10.3, Con), Other (0.2, Oth)" if countryelection == 282
replace string_SCparties = "NA" if countryelection == 282
replace string_ASparties = "Communist (3.4, EL)" if countryelection == 282

replace voteper_PSparties = 86.2  if countryelection == 282
replace voteper_CPparties = 10.5  if countryelection == 282
replace voteper_SCparties =  0    if countryelection == 282
replace voteper_ASparties =  3.4  if countryelection == 282

replace voteper_EL_ASP = 3.4    if countryelection == 282
replace voteper_RL_ASP = .       if countryelection == 282
replace voteper_ER_ASP = .        if countryelection == 282
replace voteper_RR_ASP = .      if countryelection == 282
replace voteper_GREEN_ASP = .    if countryelection == 282
replace voteper_PIRATE_ASP = .     if countryelection == 282
replace voteper_MISC_POP_ASP = .  if countryelection == 282
replace voteper_SEC_NAT_ASP = .   if countryelection == 282
replace voteper_REL_ASP = .      if countryelection == 282
replace voteper_OTHERR_ASP = .   if countryelection == 282
replace voteper_OTHERL_ASP = .    if countryelection == 282

*1961*
replace string_PSparties = "Labour (46.8), Conservative (20), Liberal (8.9), Farmer (9.3)" if countryelection == 283
replace string_CPparties = "Christian Democrat (9.6, Con), Other (0.2, Oth)" if countryelection == 283
replace string_SCparties = "NA" if countryelection == 283
replace string_ASparties = "Communist (2.9, EL), Socialist People's Party (2.4, RL)" if countryelection == 283

replace voteper_PSparties = 85   if countryelection == 283
replace voteper_CPparties =  9.8 if countryelection == 283
replace voteper_SCparties =  0   if countryelection == 283
replace voteper_ASparties =  5.3 if countryelection == 283

replace voteper_EL_ASP = 2.9    if countryelection == 283
replace voteper_RL_ASP = 2.4       if countryelection == 283
replace voteper_ER_ASP = .        if countryelection == 283
replace voteper_RR_ASP = .      if countryelection == 283
replace voteper_GREEN_ASP = .    if countryelection == 283
replace voteper_PIRATE_ASP = .     if countryelection == 283
replace voteper_MISC_POP_ASP = .  if countryelection == 283
replace voteper_SEC_NAT_ASP = .   if countryelection == 283
replace voteper_REL_ASP = .      if countryelection == 283
replace voteper_OTHERR_ASP = .   if countryelection == 283
replace voteper_OTHERL_ASP = .    if countryelection == 283

*1965*
replace string_PSparties = "Labour (43.1), Conservative (21.1), Liberal (10.4), Christian Democrat (8.1), Farmer (9.9)" if countryelection == 284
replace string_CPparties = "NA" if countryelection == 284
replace string_SCparties = "NA" if countryelection == 284
replace string_ASparties = "Communist (1.4, EL), Socialist People's Party (6, RL)" if countryelection == 284

replace voteper_PSparties = 92.6  if countryelection == 284
replace voteper_CPparties =  0    if countryelection == 284
replace voteper_SCparties =  0    if countryelection == 284
replace voteper_ASparties =  7.4  if countryelection == 284

replace voteper_EL_ASP = 1.4    if countryelection == 284
replace voteper_RL_ASP = 6       if countryelection == 284
replace voteper_ER_ASP = .        if countryelection == 284
replace voteper_RR_ASP = .      if countryelection == 284
replace voteper_GREEN_ASP = .    if countryelection == 284
replace voteper_PIRATE_ASP = .     if countryelection == 284
replace voteper_MISC_POP_ASP = .  if countryelection == 284
replace voteper_SEC_NAT_ASP = .   if countryelection == 284
replace voteper_REL_ASP = .      if countryelection == 284
replace voteper_OTHERR_ASP = .   if countryelection == 284
replace voteper_OTHERL_ASP = .    if countryelection == 284

*1969*
replace string_PSparties = "Labour (46.5), Conservative (19.6), Liberal (9.4), Christian Democrat (9.4), Farmer (10.5)" if countryelection == 285
replace string_CPparties = "Others (0.1, Oth)" if countryelection == 285
replace string_SCparties = "NA" if countryelection == 285
replace string_ASparties = "Communist (1, EL), Socialist People's Party (3.5, RL)" if countryelection == 285

replace voteper_PSparties = 95.4  if countryelection == 285
replace voteper_CPparties =  0.1  if countryelection == 285
replace voteper_SCparties =  0    if countryelection == 285
replace voteper_ASparties =  4.5  if countryelection == 285

replace voteper_EL_ASP = 1    if countryelection == 285
replace voteper_RL_ASP = 3.5       if countryelection == 285
replace voteper_ER_ASP = .        if countryelection == 285
replace voteper_RR_ASP = .      if countryelection == 285
replace voteper_GREEN_ASP = .    if countryelection == 285
replace voteper_PIRATE_ASP = .     if countryelection == 285
replace voteper_MISC_POP_ASP = .  if countryelection == 285
replace voteper_SEC_NAT_ASP = .   if countryelection == 285
replace voteper_REL_ASP = .      if countryelection == 285
replace voteper_OTHERR_ASP = .   if countryelection == 285
replace voteper_OTHERL_ASP = .    if countryelection == 285

*1973*
replace string_PSparties = "Labour (35.3), Conservative (17.4), Liberal (3.5), Christian Democrat (11.9), Farmer (11.3)" if countryelection == 286
replace string_CPparties = "Others (0.5, Oth), New People's Party (3.4, Lib)" if countryelection == 286
replace string_SCparties = "NA" if countryelection == 286
replace string_ASparties = "Socialist Left (11.2, RL), Progress Party (5, OR), Red Alliance (0.4, EL)" if countryelection == 286

replace voteper_PSparties = 79.4  if countryelection == 286
replace voteper_CPparties =  3.9  if countryelection == 286
replace voteper_SCparties =  0    if countryelection == 286
replace voteper_ASparties = 16.6  if countryelection == 286

replace voteper_EL_ASP = 0.4    if countryelection == 286
replace voteper_RL_ASP = 11.2       if countryelection == 286
replace voteper_ER_ASP = .        if countryelection == 286
replace voteper_RR_ASP = .      if countryelection == 286
replace voteper_GREEN_ASP = .    if countryelection == 286
replace voteper_PIRATE_ASP = .     if countryelection == 286
replace voteper_MISC_POP_ASP = .  if countryelection == 286
replace voteper_SEC_NAT_ASP = .   if countryelection == 286
replace voteper_REL_ASP = .      if countryelection == 286
replace voteper_OTHERR_ASP = 5   if countryelection == 286
replace voteper_OTHERL_ASP = .    if countryelection == 286

*1977*
replace string_PSparties = "Labour (42.3), Conservative (24.8), Liberal (3.2), Christian Democrat (12.4), Farmer (8.6)" if countryelection == 287
replace string_CPparties = "Others (0.6, Oth), New People's Party (1.4, Lib)" if countryelection == 287
replace string_SCparties = "NA" if countryelection == 287
replace string_ASparties = "Socialist Left (4.2, RL), Progress Party (1.9, OR), Red Alliance (0.6, EL)" if countryelection == 287

replace voteper_PSparties = 91.3  if countryelection == 287
replace voteper_CPparties =  2.0  if countryelection == 287
replace voteper_SCparties =  0    if countryelection == 287
replace voteper_ASparties =  6.7  if countryelection == 287

replace voteper_EL_ASP = 0.6    if countryelection == 287
replace voteper_RL_ASP = 4.2       if countryelection == 287
replace voteper_ER_ASP = .        if countryelection == 287
replace voteper_RR_ASP = .      if countryelection == 287
replace voteper_GREEN_ASP = .    if countryelection == 287
replace voteper_PIRATE_ASP = .     if countryelection == 287
replace voteper_MISC_POP_ASP = .  if countryelection == 287
replace voteper_SEC_NAT_ASP = .   if countryelection == 287
replace voteper_REL_ASP = .      if countryelection == 287
replace voteper_OTHERR_ASP = 1.9   if countryelection == 287
replace voteper_OTHERL_ASP = .    if countryelection == 287

*1981*
replace string_PSparties = "Labour (37.2), Conservative (31.7), Liberal (3.9), Christian Democrat (9.4), Farmer (6.7)" if countryelection == 288
replace string_CPparties = "Others (0.5, Oth), New People's Party (0.5, Lib)" if countryelection == 288
replace string_SCparties = "NA" if countryelection == 288
replace string_ASparties = "Socialist Left (4.9, RL), Progress Party (4.5, OR), Red Alliance (0.7, EL)" if countryelection == 288

replace voteper_PSparties = 88.9 if countryelection == 288
replace voteper_CPparties =  1.0 if countryelection == 288
replace voteper_SCparties =  0.0 if countryelection == 288
replace voteper_ASparties = 10.1 if countryelection == 288

replace voteper_EL_ASP = 0.7    if countryelection == 288
replace voteper_RL_ASP = 4.9       if countryelection == 288
replace voteper_ER_ASP = .        if countryelection == 288
replace voteper_RR_ASP = .      if countryelection == 288
replace voteper_GREEN_ASP = .    if countryelection == 288
replace voteper_PIRATE_ASP = .     if countryelection == 288
replace voteper_MISC_POP_ASP = .  if countryelection == 288
replace voteper_SEC_NAT_ASP = .   if countryelection == 288
replace voteper_REL_ASP = .      if countryelection == 288
replace voteper_OTHERR_ASP = 4.5   if countryelection == 288
replace voteper_OTHERL_ASP = .    if countryelection == 288

*1985*
replace string_PSparties = "Labour (40.8), Conservative (30.4), Liberal (3.1), Christian Democrat (8.3), Farmer (6.6)" if countryelection == 289
replace string_CPparties = "Others (0.5, Oth), New People's Party (0.5, Lib)" if countryelection == 289
replace string_SCparties = "NA" if countryelection == 289
replace string_ASparties = "Socialist Left (5.5, RL), Progress Party (3.7, OR), Red Alliance (0.6, EL)" if countryelection == 289

replace voteper_PSparties = 89.2  if countryelection == 289
replace voteper_CPparties =  1.0  if countryelection == 289
replace voteper_SCparties =  0    if countryelection == 289
replace voteper_ASparties =  9.8  if countryelection == 289

replace voteper_EL_ASP = 0.6    if countryelection == 289
replace voteper_RL_ASP = 5.5       if countryelection == 289
replace voteper_ER_ASP = .        if countryelection == 289
replace voteper_RR_ASP = .      if countryelection == 289
replace voteper_GREEN_ASP = .    if countryelection == 289
replace voteper_PIRATE_ASP = .     if countryelection == 289
replace voteper_MISC_POP_ASP = .  if countryelection == 289
replace voteper_SEC_NAT_ASP = .   if countryelection == 289
replace voteper_REL_ASP = .      if countryelection == 289
replace voteper_OTHERR_ASP = 3.7   if countryelection == 289
replace voteper_OTHERL_ASP = .    if countryelection == 289

*1989*
replace string_PSparties = "Labour (34.3), Conservative (22.2), Liberal (3.2), Christian Democrat (8.5), Farmer (6.5)" if countryelection == 290
replace string_CPparties = "Others (0.7, Oth), Pensioner Party (0.5, Pens)" if countryelection == 290
replace string_SCparties = "NA" if countryelection == 290
replace string_ASparties = "Socialist Left (10.1, RL), Progress Party (13, RW Pop), Red Alliance (0.8, Com), Greens (0.4, Green)" if countryelection == 290

replace voteper_PSparties = 74.7  if countryelection == 290
replace voteper_CPparties =  1.1  if countryelection == 290
replace voteper_SCparties =  0    if countryelection == 290
replace voteper_ASparties = 24.3  if countryelection == 290

replace voteper_EL_ASP = 0.8    if countryelection == 290
replace voteper_RL_ASP = 10.1       if countryelection == 290
replace voteper_ER_ASP = .        if countryelection == 290
replace voteper_RR_ASP = .      if countryelection == 290
replace voteper_GREEN_ASP = 0.4    if countryelection == 290
replace voteper_PIRATE_ASP = .     if countryelection == 290
replace voteper_MISC_POP_ASP = .  if countryelection == 290
replace voteper_SEC_NAT_ASP = .   if countryelection == 290
replace voteper_REL_ASP = .      if countryelection == 290
replace voteper_OTHERR_ASP = 13   if countryelection == 290
replace voteper_OTHERL_ASP = .    if countryelection == 290

*1993*
replace string_PSparties = "Labour (36.9), Conservative (17), Liberal (3.6), Christian Democrat (7.9), Farmer (16.7)" if countryelection == 291
replace string_CPparties = "Others (0.9, Oth), Pensioner Party (1, Pens)" if countryelection == 291
replace string_SCparties = "NA" if countryelection == 291
replace string_ASparties = "Socialist Left (7.9, RL), Progress Party (6.3, OR), Fatherland Party (0.5, RR), Red Alliance (1.1, EL), Greens (0.1, Green)" if countryelection == 291

replace voteper_PSparties = 82.1 if countryelection == 291
replace voteper_CPparties =  1.9 if countryelection == 291
replace voteper_SCparties =  0   if countryelection == 291
replace voteper_ASparties = 15.9 if countryelection == 291

replace voteper_EL_ASP = 1.1   if countryelection == 291
replace voteper_RL_ASP = 7.9       if countryelection == 291
replace voteper_ER_ASP = .        if countryelection == 291
replace voteper_RR_ASP = 0.5      if countryelection == 291
replace voteper_GREEN_ASP = 0.1    if countryelection == 291
replace voteper_PIRATE_ASP = .     if countryelection == 291
replace voteper_MISC_POP_ASP = .  if countryelection == 291
replace voteper_SEC_NAT_ASP = .   if countryelection == 291
replace voteper_REL_ASP = .      if countryelection == 291
replace voteper_OTHERR_ASP = 6.3   if countryelection == 291
replace voteper_OTHERL_ASP = .    if countryelection == 291

*1997*
replace string_PSparties = "Labour (35), Conservative (14.3), Liberal (4.5), Christian Democrat (13.7), Farmer (7.9)" if countryelection == 292
replace string_CPparties = "Others (0.6, Oth), Pensioner Party (0.6, Pens)" if countryelection == 292
replace string_SCparties = "NA" if countryelection == 292
replace string_ASparties = "Socialist Left (6, RL), Progress Party (15.3, OR), Fatherland Party (0.2, RR), Red Alliance (1.7, Com), Greens (0.2, Green)" if countryelection == 292

replace voteper_PSparties = 75.4  if countryelection == 292
replace voteper_CPparties =  1.2  if countryelection == 292
replace voteper_SCparties =  0    if countryelection == 292
replace voteper_ASparties = 23.4  if countryelection == 292

replace voteper_EL_ASP = 1.7   if countryelection == 292
replace voteper_RL_ASP = 6       if countryelection == 292
replace voteper_ER_ASP = .        if countryelection == 292
replace voteper_RR_ASP = 0.2      if countryelection == 292
replace voteper_GREEN_ASP = 0.2    if countryelection == 292
replace voteper_PIRATE_ASP = .     if countryelection == 292
replace voteper_MISC_POP_ASP = .  if countryelection == 292
replace voteper_SEC_NAT_ASP = .   if countryelection == 292
replace voteper_REL_ASP = .      if countryelection == 292
replace voteper_OTHERR_ASP = 15.3   if countryelection == 292
replace voteper_OTHERL_ASP = .    if countryelection == 292

*2001*
replace string_PSparties = "Labour (24.3), Conservative (21.2), Liberal (3.9), Christian Democrat (12.4), Farmer (5.6)" if countryelection == 293
replace string_CPparties = "Others (0.7, Oth), Pensioner Party (0.7, Pens), Socialist Left (12.5, RL), Coastal Party (1.7, Reg)" if countryelection == 293
replace string_SCparties = "NA" if countryelection == 293
replace string_ASparties = "Progress Party (14.6, OR), The Party (0.8, OL), Fatherland Party (0.1, RR), Red Alliance (1.2, Com), Greens (0.2, Green)" if countryelection == 293

replace voteper_PSparties = 67.4  if countryelection == 293
replace voteper_CPparties = 15.6  if countryelection == 293
replace voteper_SCparties = 0     if countryelection == 293
replace voteper_ASparties = 16.9  if countryelection == 293

replace voteper_EL_ASP = 1.2   if countryelection == 293
replace voteper_RL_ASP = .       if countryelection == 293
replace voteper_ER_ASP = .        if countryelection == 293
replace voteper_RR_ASP = 0.1      if countryelection == 293
replace voteper_GREEN_ASP = 0.2    if countryelection == 293
replace voteper_PIRATE_ASP = .     if countryelection == 293
replace voteper_MISC_POP_ASP = .  if countryelection == 293
replace voteper_SEC_NAT_ASP = .   if countryelection == 293
replace voteper_REL_ASP = .      if countryelection == 293
replace voteper_OTHERR_ASP = 14.6   if countryelection == 293
replace voteper_OTHERL_ASP = 0.8    if countryelection == 293

*2005*
replace string_PSparties = "Labour (32.7), Conservative (14.1), Liberal (5.9), Christian Democrat (6.8), Farmer (6.5)" if countryelection == 294
replace string_CPparties = "Others (0.4, Oth), Pensioner Party (0.5, Pens), Socialist Left (8.8, RL), Coastal Party (0.8, Reg)" if countryelection == 294
replace string_SCparties = "Progress Party (22.1, RW Pop)" if countryelection == 294
replace string_ASparties = "Red Alliance (1.2, EL), Greens (0.1, Green)" if countryelection == 294

replace voteper_PSparties = 66  if countryelection == 294
replace voteper_CPparties = 10.5   if countryelection == 294
replace voteper_SCparties = 22.1   if countryelection == 294
replace voteper_ASparties =  1.3 if countryelection == 294

replace voteper_EL_ASP = 1.2   if countryelection == 294
replace voteper_RL_ASP = .       if countryelection == 294
replace voteper_ER_ASP = .        if countryelection == 294
replace voteper_RR_ASP = .      if countryelection == 294
replace voteper_GREEN_ASP = 0.1    if countryelection == 294
replace voteper_PIRATE_ASP = .     if countryelection == 294
replace voteper_MISC_POP_ASP = .  if countryelection == 294
replace voteper_SEC_NAT_ASP = .   if countryelection == 294
replace voteper_REL_ASP = .      if countryelection == 294
replace voteper_OTHERR_ASP = .   if countryelection == 294
replace voteper_OTHERL_ASP = .    if countryelection == 294

*2009*
replace string_PSparties = "Labour (35.4), Progress Party (22.9), Conservative (17.2), Liberal (3.9), Christian Democrat (5.5), Farmer (6.2), Socialist Left (6.2)" if countryelection == 295
replace string_CPparties = "Others (0.6, Oth), Pensioner Party (0.4, Pens)" if countryelection == 295
replace string_SCparties = "NA" if countryelection == 295
replace string_ASparties = "Red Alliance (1.3, EL), Greens (0.3, Green)" if countryelection == 295

replace voteper_PSparties = 97.3  if countryelection == 295
replace voteper_CPparties =  1.0  if countryelection == 295
replace voteper_SCparties =  0    if countryelection == 295
replace voteper_ASparties =  1.6  if countryelection == 295

replace voteper_EL_ASP = 1.3   if countryelection == 295
replace voteper_RL_ASP = .       if countryelection == 295
replace voteper_ER_ASP = .        if countryelection == 295
replace voteper_RR_ASP = .      if countryelection == 295
replace voteper_GREEN_ASP = 0.3    if countryelection == 295
replace voteper_PIRATE_ASP = .     if countryelection == 295
replace voteper_MISC_POP_ASP = .  if countryelection == 295
replace voteper_SEC_NAT_ASP = .   if countryelection == 295
replace voteper_REL_ASP = .      if countryelection == 295
replace voteper_OTHERR_ASP = .   if countryelection == 295
replace voteper_OTHERL_ASP = .    if countryelection == 295

*2013*
replace string_PSparties = "Labour (30.8), Progress Party (16.3), Conservative (26.8), Liberal (5.2), Christian Democrat (5.6), Farmer (5.5), Socialist Left (4.1)" if countryelection == 296
replace string_CPparties = "Others (0.3, Oth), Christians (0.6, Rel), Pensioners Party (0.4)" if countryelection == 296
replace string_SCparties = "NA" if countryelection == 296
replace string_ASparties = "Red Alliance (1.1, EL), Greens (2.8, Green), Pirate Party (0.3, Pirate)" if countryelection == 296

replace voteper_PSparties = 94.4  if countryelection == 296
replace voteper_CPparties =  1.3  if countryelection == 296
replace voteper_SCparties =  0    if countryelection == 296
replace voteper_ASparties =  4.2  if countryelection == 296

replace voteper_EL_ASP = 1.1   if countryelection == 296
replace voteper_RL_ASP = .       if countryelection == 296
replace voteper_ER_ASP = .        if countryelection == 296
replace voteper_RR_ASP = .      if countryelection == 296
replace voteper_GREEN_ASP = 2.8    if countryelection == 296
replace voteper_PIRATE_ASP = 0.3     if countryelection == 296
replace voteper_MISC_POP_ASP = .  if countryelection == 296
replace voteper_SEC_NAT_ASP = .   if countryelection == 296
replace voteper_REL_ASP = .      if countryelection == 296
replace voteper_OTHERR_ASP = .   if countryelection == 296
replace voteper_OTHERL_ASP = .    if countryelection == 296




*********************************************************** PORTUGAL ************************************************************

***** Source:  Nohlen (2010) [1976-2005]
*              Comissão Nacional de Eleições - National Election Commission Website [2009 - 2015] (Adjusted so as % of valid votes cast).


*1976*
replace string_PSparties = "NA" if countryelection == 297
replace string_CPparties = "Socialist (36.6), Other (0.6, Oth)" if countryelection == 297
replace string_SCparties = "NA" if countryelection == 297
replace string_ASparties = "Social Democrats (25.6, RW), Democratic and Social Centre (16.8, RW), Communist (15.1, Com), Minor Far Left (4.2, Com), Monarchists (0.5, Con), Christ Dem (0.6, Con)" if countryelection == 297

replace voteper_PSparties =  0 if countryelection == 297
replace voteper_CPparties =  37.2  if countryelection == 297
replace voteper_SCparties =  0   if countryelection == 297
replace voteper_ASparties =  62.8 if countryelection == 297

replace voteper_EL_ASP = 19.3   if countryelection == 297
replace voteper_RL_ASP = .       if countryelection == 297
replace voteper_ER_ASP = .        if countryelection == 297
replace voteper_RR_ASP = .      if countryelection == 297
replace voteper_GREEN_ASP = .    if countryelection == 297
replace voteper_PIRATE_ASP = .     if countryelection == 297
replace voteper_MISC_POP_ASP = .  if countryelection == 297
replace voteper_SEC_NAT_ASP = .   if countryelection == 297
replace voteper_REL_ASP = .      if countryelection == 297
replace voteper_OTHERR_ASP = 43.5   if countryelection == 297
replace voteper_OTHERL_ASP = .    if countryelection == 297

*1979*
replace string_PSparties = "Socialist (28.1)" if countryelection == 298
replace string_CPparties = "Other (0.2, Oth)" if countryelection == 298
replace string_SCparties = "NA" if countryelection == 298
replace string_ASparties = "Social Democrats (46.5, RW), Communist (19.3, Com), Minor Far Left (4.7, Com), Christ Dem (1.2, Con)" if countryelection == 298

replace voteper_PSparties = 28.1  if countryelection == 298
replace voteper_CPparties =  0.2  if countryelection == 298
replace voteper_SCparties =  0  if countryelection == 298
replace voteper_ASparties = 71.7  if countryelection == 298

replace voteper_EL_ASP = 24   if countryelection == 298
replace voteper_RL_ASP = .       if countryelection == 298
replace voteper_ER_ASP = .        if countryelection == 298
replace voteper_RR_ASP = .      if countryelection == 298
replace voteper_GREEN_ASP = .    if countryelection == 298
replace voteper_PIRATE_ASP = .     if countryelection == 298
replace voteper_MISC_POP_ASP = .  if countryelection == 298
replace voteper_SEC_NAT_ASP = .   if countryelection == 298
replace voteper_REL_ASP = .      if countryelection == 298
replace voteper_OTHERR_ASP = 47.7   if countryelection == 298
replace voteper_OTHERL_ASP = .    if countryelection == 298

*1980*
replace string_PSparties = "Socialist (28.4)" if countryelection == 299
replace string_CPparties = "Other (0.2, Oth)" if countryelection == 299
replace string_SCparties = "Social Democrats (48.7, RW)" if countryelection == 299
replace string_ASparties = "Communist (17.1, Com), Minor Far Left (5.1, Com), Christ Dem (0.4, Con)" if countryelection == 299

replace voteper_PSparties = 28.4  if countryelection == 299
replace voteper_CPparties =  0.2  if countryelection == 299
replace voteper_SCparties = 48.7  if countryelection == 299
replace voteper_ASparties = 22.6  if countryelection == 299

replace voteper_EL_ASP = 22.2   if countryelection == 299
replace voteper_RL_ASP = .       if countryelection == 299
replace voteper_ER_ASP = .        if countryelection == 299
replace voteper_RR_ASP = .      if countryelection == 299
replace voteper_GREEN_ASP = .    if countryelection == 299
replace voteper_PIRATE_ASP = .     if countryelection == 299
replace voteper_MISC_POP_ASP = .  if countryelection == 299
replace voteper_SEC_NAT_ASP = .   if countryelection == 299
replace voteper_REL_ASP = .      if countryelection == 299
replace voteper_OTHERR_ASP = 0.4   if countryelection == 299
replace voteper_OTHERL_ASP = .    if countryelection == 299

*1983*
replace string_PSparties = "Socialist (37.1)" if countryelection == 300
replace string_CPparties = "Other (0.6, Oth)" if countryelection == 300
replace string_SCparties = "Social Democrats (28, RW), Democratic and Social Centre (12.9, RW), Monarchists (0.5, Con)" if countryelection == 300
replace string_ASparties = "Communist (18.6, Com), Minor Far Left (1.6, Com), Christ Dem (0.7, Con)" if countryelection == 300

replace voteper_PSparties = 37.1  if countryelection == 300
replace voteper_CPparties =  0.6  if countryelection == 300
replace voteper_SCparties = 41.4  if countryelection == 300
replace voteper_ASparties = 20.9  if countryelection == 300

replace voteper_EL_ASP = 20.2   if countryelection == 300
replace voteper_RL_ASP = .       if countryelection == 300
replace voteper_ER_ASP = .        if countryelection == 300
replace voteper_RR_ASP = .      if countryelection == 300
replace voteper_GREEN_ASP = .    if countryelection == 300
replace voteper_PIRATE_ASP = .     if countryelection == 300
replace voteper_MISC_POP_ASP = .  if countryelection == 300
replace voteper_SEC_NAT_ASP = .   if countryelection == 300
replace voteper_REL_ASP = .      if countryelection == 300
replace voteper_OTHERR_ASP = 0.7   if countryelection == 300
replace voteper_OTHERL_ASP = .    if countryelection == 300

*1985*
replace string_PSparties = "Socialist (21.3), Social Democrats (30.6, RW), Democratic and Social Centre (10.2, RW)" if countryelection == 301
replace string_CPparties = "Democratic Renewal (18.4, LW), Other (0.9, Oth)" if countryelection == 301
replace string_SCparties = "NA" if countryelection == 301
replace string_ASparties = "Communist (15.9, Com), Minor Far Left (1.9, Com), Christ Dem (0.7, Con)" if countryelection == 301

replace voteper_PSparties = 62.1  if countryelection == 301
replace voteper_CPparties = 19.3  if countryelection == 301
replace voteper_SCparties = 0     if countryelection == 301
replace voteper_ASparties = 18.5  if countryelection == 301

replace voteper_EL_ASP = 17.8   if countryelection == 301
replace voteper_RL_ASP = .       if countryelection == 301
replace voteper_ER_ASP = .        if countryelection == 301
replace voteper_RR_ASP = .      if countryelection == 301
replace voteper_GREEN_ASP = .    if countryelection == 301
replace voteper_PIRATE_ASP = .     if countryelection == 301
replace voteper_MISC_POP_ASP = .  if countryelection == 301
replace voteper_SEC_NAT_ASP = .   if countryelection == 301
replace voteper_REL_ASP = .      if countryelection == 301
replace voteper_OTHERR_ASP = 0.7   if countryelection == 301
replace voteper_OTHERL_ASP = .    if countryelection == 301

*1987*
replace string_PSparties = "Democratic Renewal (5), Socialist (22.7), Social Democrats (51.3, RW), Democratic and Social Centre (4.5, RW)" if countryelection == 302
replace string_CPparties = "Other (1.1, Oth)" if countryelection == 302
replace string_SCparties = "NA" if countryelection == 302
replace string_ASparties = "Communists (11.6, EL), Green (0.8, Green) Minor Far Left (2.4, EL), Christ Dem (0.6, OR)" if countryelection == 302

replace voteper_PSparties = 83.5  if countryelection == 302
replace voteper_CPparties =  1.1  if countryelection == 302
replace voteper_SCparties =   0   if countryelection == 302
replace voteper_ASparties = 15.4  if countryelection == 302

replace voteper_EL_ASP = 14   if countryelection == 302
replace voteper_RL_ASP = .       if countryelection == 302
replace voteper_ER_ASP = .        if countryelection == 302
replace voteper_RR_ASP = .      if countryelection == 302
replace voteper_GREEN_ASP = 0.8    if countryelection == 302
replace voteper_PIRATE_ASP = .     if countryelection == 302
replace voteper_MISC_POP_ASP = .  if countryelection == 302
replace voteper_SEC_NAT_ASP = .   if countryelection == 302
replace voteper_REL_ASP = .      if countryelection == 302
replace voteper_OTHERR_ASP = 0.6   if countryelection == 302
replace voteper_OTHERL_ASP = .    if countryelection == 302

*1991*
replace string_PSparties = "Social Democrats (51.6), Democratic and Social Centre (4.5), Democratic Renewal (0.6), Socialist (29.7)" if countryelection == 303
replace string_CPparties = "Other (0.8, Oth), National Solidarity (1.7, Pens)" if countryelection == 303
replace string_SCparties = "NA" if countryelection == 303
replace string_ASparties = "Communist (8, EL), Green (1, Green), Minor Far Left (2.1, EL)" if countryelection == 303

replace voteper_PSparties = 86.4  if countryelection == 303
replace voteper_CPparties =  2.5  if countryelection == 303
replace voteper_SCparties =  0    if countryelection == 303
replace voteper_ASparties = 11.1  if countryelection == 303

replace voteper_EL_ASP = 10.1   if countryelection == 303
replace voteper_RL_ASP = .       if countryelection == 303
replace voteper_ER_ASP = .        if countryelection == 303
replace voteper_RR_ASP = .      if countryelection == 303
replace voteper_GREEN_ASP = 1    if countryelection == 303
replace voteper_PIRATE_ASP = .     if countryelection == 303
replace voteper_MISC_POP_ASP = .  if countryelection == 303
replace voteper_SEC_NAT_ASP = .   if countryelection == 303
replace voteper_REL_ASP = .      if countryelection == 303
replace voteper_OTHERR_ASP = .   if countryelection == 303
replace voteper_OTHERL_ASP = .    if countryelection == 303

*1995*
replace string_PSparties = "Social Democrats (34.8), Democratic and Social Centre (9.2), Socialist (44.6)" if countryelection == 304
replace string_CPparties = "Other (0.6, Oth), National Solidarity (0.2, Pens)" if countryelection == 304
replace string_SCparties = "NA" if countryelection == 304
replace string_ASparties = "Communist (7.5, Com), Green (1.2, Green), Minor Far Left (1.9, Com)" if countryelection == 304

replace voteper_PSparties = 88.6  if countryelection == 304
replace voteper_CPparties =  0.8  if countryelection == 304
replace voteper_SCparties =  0    if countryelection == 304
replace voteper_ASparties = 10.6  if countryelection == 304

replace voteper_EL_ASP = 9.4   if countryelection == 304
replace voteper_RL_ASP = .       if countryelection == 304
replace voteper_ER_ASP = .        if countryelection == 304
replace voteper_RR_ASP = .      if countryelection == 304
replace voteper_GREEN_ASP = 1.2    if countryelection == 304
replace voteper_PIRATE_ASP = .     if countryelection == 304
replace voteper_MISC_POP_ASP = .  if countryelection == 304
replace voteper_SEC_NAT_ASP = .   if countryelection == 304
replace voteper_REL_ASP = .      if countryelection == 304
replace voteper_OTHERR_ASP = .   if countryelection == 304
replace voteper_OTHERL_ASP = .    if countryelection == 304

*1999*
replace string_PSparties = "Social Democrats (33), Democratic and Social Centre (8.5), Socialist (45)" if countryelection == 305
replace string_CPparties = "Other (1.1, Oth)" if countryelection == 305
replace string_SCparties = "NA" if countryelection == 305
replace string_ASparties = "Communist (8.1, EL), Green (1.1, Green), Workers' Communist (0.8, EL), Left Bloc (2.5, RL)" if countryelection == 305

replace voteper_PSparties = 86.5  if countryelection == 305
replace voteper_CPparties =  1.1  if countryelection == 305
replace voteper_SCparties =  0    if countryelection == 305
replace voteper_ASparties = 12.5  if countryelection == 305

replace voteper_EL_ASP = 8.9   if countryelection == 305
replace voteper_RL_ASP = 2.5       if countryelection == 305
replace voteper_ER_ASP = .        if countryelection == 305
replace voteper_RR_ASP = .      if countryelection == 305
replace voteper_GREEN_ASP = 1.1    if countryelection == 305
replace voteper_PIRATE_ASP = .     if countryelection == 305
replace voteper_MISC_POP_ASP = .  if countryelection == 305
replace voteper_SEC_NAT_ASP = .   if countryelection == 305
replace voteper_REL_ASP = .      if countryelection == 305
replace voteper_OTHERR_ASP = .   if countryelection == 305
replace voteper_OTHERL_ASP = .    if countryelection == 305

*2002*
replace string_PSparties = "Social Democrats (41), Democratic and Social Centre (8.9), Socialist (38.6)" if countryelection == 306
replace string_CPparties = "Other (0.8, Oth)" if countryelection == 306
replace string_SCparties = "NA" if countryelection == 306
replace string_ASparties = "Communist (5.1, Com), Green (2, Green), Workers' Communist (0.7, Com), Left Bloc (2.9, RL), National Rennovator (0.1, RR)" if countryelection == 306

replace voteper_PSparties = 88.5  if countryelection == 306
replace voteper_CPparties =  0.8  if countryelection == 306
replace voteper_SCparties =  0    if countryelection == 306
replace voteper_ASparties = 10.8  if countryelection == 306

replace voteper_EL_ASP = 5.8  if countryelection == 306
replace voteper_RL_ASP = 2.9       if countryelection == 306
replace voteper_ER_ASP = .        if countryelection == 306
replace voteper_RR_ASP = 0.1      if countryelection == 306
replace voteper_GREEN_ASP = 2    if countryelection == 306
replace voteper_PIRATE_ASP = .     if countryelection == 306
replace voteper_MISC_POP_ASP = .  if countryelection == 306
replace voteper_SEC_NAT_ASP = .   if countryelection == 306
replace voteper_REL_ASP = .      if countryelection == 306
replace voteper_OTHERR_ASP = .   if countryelection == 306
replace voteper_OTHERL_ASP = .    if countryelection == 306

*2005*
replace string_PSparties = "Social Democrats (29.6), Democratic and Social Centre (7.5), Socialist (46.4)" if countryelection == 307
replace string_CPparties = "Other (1.2, Oth)" if countryelection == 307
replace string_SCparties = "NA" if countryelection == 307
replace string_ASparties = "Communist (6.7, Com), Green (1.1, Green), Workers' Communist (0.9, Com), Left Bloc (6.5, RL), National Rennovator (0.1, RR)" if countryelection == 307

replace voteper_PSparties = 83.5  if countryelection == 307
replace voteper_CPparties =  1.2  if countryelection == 307
replace voteper_SCparties =  0    if countryelection == 307
replace voteper_ASparties = 15.3  if countryelection == 307

replace voteper_EL_ASP = 7.6   if countryelection == 307
replace voteper_RL_ASP = 6.5       if countryelection == 307
replace voteper_ER_ASP = .        if countryelection == 307
replace voteper_RR_ASP = 0.1      if countryelection == 307
replace voteper_GREEN_ASP = 1.1    if countryelection == 307
replace voteper_PIRATE_ASP = .     if countryelection == 307
replace voteper_MISC_POP_ASP = .  if countryelection == 307
replace voteper_SEC_NAT_ASP = .   if countryelection == 307
replace voteper_REL_ASP = .      if countryelection == 307
replace voteper_OTHERR_ASP = .   if countryelection == 307
replace voteper_OTHERL_ASP = .    if countryelection == 307

*2009*
replace string_PSparties = "Social Democrats (30), Democratic and Social Centre (10.8), Socialist (37.7)" if countryelection == 308
replace string_CPparties = "Other (0.7, Oth), Hope for Portugal (0.5, Lib), Liberal Democratic Party (0.3), Humanists and Ecologists (0.2)" if countryelection == 308
replace string_SCparties = "NA" if countryelection == 308
replace string_ASparties = "Communist (6, Com), Green (2.1, Green), Workers' Communist (1, Com), Left Bloc (10.1, RL), National Rennovator (0.2, RR), New Democracy (0.4, OR)" if countryelection == 308

replace voteper_PSparties = 78.5  if countryelection == 308
replace voteper_CPparties =  1.7  if countryelection == 308
replace voteper_SCparties =  0    if countryelection == 308
replace voteper_ASparties = 19.8 if countryelection == 308

replace voteper_EL_ASP = 7       if countryelection == 308
replace voteper_RL_ASP = 10.1       if countryelection == 308
replace voteper_ER_ASP = .        if countryelection == 308
replace voteper_RR_ASP = 0.2      if countryelection == 308
replace voteper_GREEN_ASP = 2.1    if countryelection == 308
replace voteper_PIRATE_ASP = .     if countryelection == 308
replace voteper_MISC_POP_ASP = .  if countryelection == 308
replace voteper_SEC_NAT_ASP = .   if countryelection == 308
replace voteper_REL_ASP = .      if countryelection == 308
replace voteper_OTHERR_ASP = 0.4   if countryelection == 308
replace voteper_OTHERL_ASP = .    if countryelection == 308

*2011*
replace string_PSparties = "Social Democrats (40.3), Democratic and Social Centre (12.2), Socialist (29.2)" if countryelection == 309
replace string_CPparties = "Party for Animals (1.1, Green), Earth Party (0.4), Hope for Portugal (0.4), Workers Party (0.3), Other (0.5)" if countryelection == 309
replace string_SCparties = "NA" if countryelection == 309
replace string_ASparties = "Communist (7.2, Com), Green (1, Green), Workers' Communist (1.2, Com), Left Bloc (5.4, RL), National Rennovator (0.3, RR), Monarchists (0.3, OR), New Democracy (0.2)" if countryelection == 309

replace voteper_PSparties = 81.7  if countryelection == 309
replace voteper_CPparties =  2.7  if countryelection == 309
replace voteper_SCparties =  0.0   if countryelection == 309
replace voteper_ASparties = 15.6  if countryelection == 309

replace voteper_EL_ASP = 8.4   if countryelection == 309
replace voteper_RL_ASP = 5.4       if countryelection == 309
replace voteper_ER_ASP = .        if countryelection == 309
replace voteper_RR_ASP = 0.3      if countryelection == 309
replace voteper_GREEN_ASP = 1    if countryelection == 309
replace voteper_PIRATE_ASP = .     if countryelection == 309
replace voteper_MISC_POP_ASP = .  if countryelection == 309
replace voteper_SEC_NAT_ASP = .   if countryelection == 309
replace voteper_REL_ASP = .      if countryelection == 309
replace voteper_OTHERR_ASP = 0.5   if countryelection == 309
replace voteper_OTHERL_ASP = .    if countryelection == 309

*2015*
replace string_PSparties = "Social Democrats (36.9), Socialist (33.6), Earth (0.4)" if countryelection == 310
replace string_CPparties = "Other (3.8, Oth), Party for Animals (1.4, Green), LIVRE (0.8, Green), Democratic Republican (1.2, Lib)" if countryelection == 310
replace string_SCparties = "NA" if countryelection == 310
replace string_ASparties = "Communist (7.6, Com), Green (1, Green), Citizens (0.3, Misc. Pop), Workers' Communist (1.2, Com), Left Bloc (10.6, RL), National Rennovator (0.5, RR), ACT (0.4, EL), Monarchists (0.3, OR)" if countryelection == 310

replace voteper_PSparties = 70.9  if countryelection == 310
replace voteper_CPparties =  7.2  if countryelection == 310
replace voteper_SCparties =  0   if countryelection == 310
replace voteper_ASparties = 21.9  if countryelection == 310

replace voteper_EL_ASP = 9.2   if countryelection == 310
replace voteper_RL_ASP = 10.6       if countryelection == 310
replace voteper_ER_ASP = .        if countryelection == 310
replace voteper_RR_ASP = 0.5      if countryelection == 310
replace voteper_GREEN_ASP = 1    if countryelection == 310
replace voteper_PIRATE_ASP = .     if countryelection == 310
replace voteper_MISC_POP_ASP = 0.3  if countryelection == 310
replace voteper_SEC_NAT_ASP = .   if countryelection == 310
replace voteper_REL_ASP = .      if countryelection == 310
replace voteper_OTHERR_ASP = 0.3   if countryelection == 310
replace voteper_OTHERL_ASP = .    if countryelection == 310


********************************************************* SPAIN *********************************************************************

***** Source: Ministerio del Interior - Ministry of the Interior Website [1977 - 2016] 

*1977*
replace string_PSparties = "NA" if countryelection == 311
replace string_CPparties = "Other (4.4), Union of the Democratic Centre (34.4, Con), PSOE (29.3, LW), People's Socialist (4.5, LW), Social Democratic Alliance (0.6, LW), Catalonia Christ Dem (0.9, Rel), Christian Democratic Pact (1.2, Con)" if countryelection == 311
replace string_SCparties = "NA" if countryelection == 311
replace string_ASparties = "Communist (9.3, Com), People's Alliance (ER, 8.2), Catalonia Pact (2.8, Sec), Basque Nationalist (1.6, Sec), Catalonia Left (0.8, RL), Basque Left (0.3, Com), Democratic Left Front (0.7, Com), National Alliance (0.4, ER), Minor Falangists (0.3, ER), Workers Electoral Group (0.4, EL)" if countryelection == 311

replace voteper_PSparties = 0 if countryelection == 311
replace voteper_CPparties = 75.5    if countryelection == 311
replace voteper_SCparties = 0    if countryelection == 311
replace voteper_ASparties = 24.5  if countryelection == 311

replace voteper_EL_ASP = 10.4  if countryelection == 311
replace voteper_RL_ASP = 0.8       if countryelection == 311
replace voteper_ER_ASP = 8.9        if countryelection == 311
replace voteper_RR_ASP = .      if countryelection == 311
replace voteper_GREEN_ASP = .    if countryelection == 311
replace voteper_PIRATE_ASP = .     if countryelection == 311
replace voteper_MISC_POP_ASP = .  if countryelection == 311
replace voteper_SEC_NAT_ASP = 4.4   if countryelection == 311
replace voteper_REL_ASP = .      if countryelection == 311
replace voteper_OTHERR_ASP = .   if countryelection == 311
replace voteper_OTHERL_ASP = .    if countryelection == 311

*1979*
replace string_PSparties = "Union of the Democratic Centre (35.1)" if countryelection == 312
replace string_CPparties = "Other (5.2), Convergence and Union (2.7, Sec), PSOE (30.5, LW), People's Alliance (RW, 6)" if countryelection == 312
replace string_SCparties = "NA" if countryelection == 312
replace string_ASparties = "Communist (10.8, Com), National Union (2.1, ER), Andalusia Party (1.8, Sec), Basque Nationalist (1.5, Sec), Catalonia Left (0.7, RL), Basque Left (0.5, Com), Democratic Left Front (0.5, Com), Minor Falangists (0.2, ER), Popular Basque Unity (1.1, Sec), Canarian People's Union (0.3, Sec), Labour (1.1, Com)" if countryelection == 312

replace voteper_PSparties = 35.1 if countryelection == 312
replace voteper_CPparties = 44.4 if countryelection == 312
replace voteper_SCparties = 0    if countryelection == 312
replace voteper_ASparties = 20.6 if countryelection == 312

replace voteper_EL_ASP = 12.9  if countryelection == 312
replace voteper_RL_ASP = 0.7       if countryelection == 312
replace voteper_ER_ASP = 2.3        if countryelection == 312
replace voteper_RR_ASP = .      if countryelection == 312
replace voteper_GREEN_ASP = .    if countryelection == 312
replace voteper_PIRATE_ASP = .     if countryelection == 312
replace voteper_MISC_POP_ASP = .  if countryelection == 312
replace voteper_SEC_NAT_ASP = 4.7 if countryelection == 312
replace voteper_REL_ASP = .      if countryelection == 312
replace voteper_OTHERR_ASP = .   if countryelection == 312
replace voteper_OTHERL_ASP = .    if countryelection == 312

*1982* (PA voted in Calvo-Sotelo's 1981 investiture)
replace string_PSparties = "People's Alliance (RW, 26.5), Convergence and Union (3.7, Reg), Union of the Democratic Centre (6.5), Democratic and Social Center (2.9)" if countryelection == 313
replace string_CPparties = "Other (3.0), PSOE (48.3, LW)" if countryelection == 313
replace string_SCparties = "Andalusia Party (0.4, Sec)" if countryelection == 313
replace string_ASparties = "Communist (3.3, Com), Basque Nationalist (1.9, Sec), Catalonia Left (1.5, RL), Basque Left (0.5, Com), Democratic Left Front (0.5, Com), Popular Basque Unity (1, Sec)" if countryelection == 313

replace voteper_PSparties = 39.6 if countryelection == 313
replace voteper_CPparties = 51.3 if countryelection == 313
replace voteper_SCparties =  0.4 if countryelection == 313
replace voteper_ASparties =  8.7 if countryelection == 313

replace voteper_EL_ASP = 4.3  if countryelection == 313
replace voteper_RL_ASP = 1.5       if countryelection == 313
replace voteper_ER_ASP = .        if countryelection == 313
replace voteper_RR_ASP = .      if countryelection == 313
replace voteper_GREEN_ASP = .    if countryelection == 313
replace voteper_PIRATE_ASP = .     if countryelection == 313
replace voteper_MISC_POP_ASP = .  if countryelection == 313
replace voteper_SEC_NAT_ASP = 2.9   if countryelection == 313
replace voteper_REL_ASP = .      if countryelection == 313
replace voteper_OTHERR_ASP = .   if countryelection == 313
replace voteper_OTHERL_ASP = .    if countryelection == 313

*1986*
replace string_PSparties = "PSOE (44.1), Convergence and Union (5.0, Sec), People's Alliance (RW, 26), Democratic and Social Center (9.2), Valencian Union (0.3, Reg)" if countryelection == 314
replace string_CPparties = "Other (4.2), Democratic Reformist Party (1)" if countryelection == 314
replace string_SCparties = "Basque Left (0.5, Com), Andalusia Party (0.5, Sec)" if countryelection == 314
replace string_ASparties = "United Left (4.6, RL),  Basque Nationalist (1.5, Sec), Catalonia Left (0.4, RL),  Democratic Left Front (1.1, Com), Popular Basque Unity (1.2, Sec), Socialist Workers Party (0.4, EL)" if countryelection == 314

replace voteper_PSparties = 84.6   if countryelection == 314
replace voteper_CPparties =  5.2   if countryelection == 314
replace voteper_SCparties =  1.0   if countryelection == 314
replace voteper_ASparties =  9.2   if countryelection == 314

replace voteper_EL_ASP = 1.5  if countryelection == 314
replace voteper_RL_ASP = 5.0       if countryelection == 314
replace voteper_ER_ASP = .        if countryelection == 314
replace voteper_RR_ASP = .      if countryelection == 314
replace voteper_GREEN_ASP = .    if countryelection == 314
replace voteper_PIRATE_ASP = .     if countryelection == 314
replace voteper_MISC_POP_ASP = .  if countryelection == 314
replace voteper_SEC_NAT_ASP = 2.7   if countryelection == 314
replace voteper_REL_ASP = .      if countryelection == 314
replace voteper_OTHERR_ASP = .   if countryelection == 314
replace voteper_OTHERL_ASP = .    if countryelection == 314

*1989*
replace string_PSparties = "PSOE (39.6), People's Party (RW, 25.8), Convergence and Union (5.0, Sec), Democratic and Social Center (7.9), Canarian Independent Group (0.3), Valencian Union (0.7, Reg)" if countryelection == 315
replace string_CPparties = "Other (2.6), Aragonese Party (0.4)" if countryelection == 315
replace string_SCparties = "Basque Left (0.5, Com), Andalusia Party (1, Sec)" if countryelection == 315
replace string_ASparties = "United Left (9.1, RL), Ruiz Mateos Group (1.1, Misc. Pop), Basque Solidarity (0.7, Sec), Green Candidates (1.5, Green), Basque Nationalist (1.2, Sec), Catalonia Left (0.4, RL), Workers Communist (0.4, Com), People's Communist Party (0.3, EL), Popular Basque Unity (1.1, Sec), Galician Coalition (0.4, Sec)" if countryelection == 315

replace voteper_PSparties = 79.3 if countryelection == 315
replace voteper_CPparties =  3.0 if countryelection == 315
replace voteper_SCparties =  1.5 if countryelection == 315
replace voteper_ASparties = 16.2 if countryelection == 315

replace voteper_EL_ASP = 0.7  if countryelection == 315
replace voteper_RL_ASP = 9.5       if countryelection == 315
replace voteper_ER_ASP = .        if countryelection == 315
replace voteper_RR_ASP = .      if countryelection == 315
replace voteper_GREEN_ASP = 1.5    if countryelection == 315
replace voteper_PIRATE_ASP = .     if countryelection == 315
replace voteper_MISC_POP_ASP = 1.1  if countryelection == 315
replace voteper_SEC_NAT_ASP = 3.4   if countryelection == 315
replace voteper_REL_ASP = .      if countryelection == 315
replace voteper_OTHERR_ASP = .   if countryelection == 315
replace voteper_OTHERL_ASP = .    if countryelection == 315

*1993*
replace string_PSparties = "PSOE (38.8), People's Party (RW, 34.8), Aragonese Party (0.6), Convergence and Union (4.9, Sec), Democratic and Social Center (1.8), Canarian Coalition (0.9), Valencian Union (0.5, Reg)" if countryelection == 316
replace string_CPparties = "Other (2.9)" if countryelection == 316
replace string_SCparties = "Andalusia Party (0.4, Sec)" if countryelection == 316
replace string_ASparties = "United Left (9.6, RL), Republican Left of Catalonia (0.8, Sec), Basque Nationalist (1.2, Sec), Basque Solidarity (0.6, Sec), Green Candidates (0.8, Green), Popular Basque Unity (0.9, Sec), Galician Coalition (0.5, Sec)" if countryelection == 316

replace voteper_PSparties = 82.3 if countryelection == 316
replace voteper_CPparties =  2.9 if countryelection == 316
replace voteper_SCparties =  0.4 if countryelection == 316
replace voteper_ASparties = 14.4 if countryelection == 316

replace voteper_EL_ASP = .  if countryelection == 316
replace voteper_RL_ASP = 9.6       if countryelection == 316
replace voteper_ER_ASP = .        if countryelection == 316
replace voteper_RR_ASP = .      if countryelection == 316
replace voteper_GREEN_ASP = 0.8    if countryelection == 316
replace voteper_PIRATE_ASP = .     if countryelection == 316
replace voteper_MISC_POP_ASP = .  if countryelection == 316
replace voteper_SEC_NAT_ASP = 4.0   if countryelection == 316
replace voteper_REL_ASP = .      if countryelection == 316
replace voteper_OTHERR_ASP = .   if countryelection == 316
replace voteper_OTHERL_ASP = .    if countryelection == 316

*1996*
replace string_PSparties = "PSOE (37.6), People's Party (RW, 38.8), Convergence and Union (4.6, Sec), Aragonese Party (0.6), Canarian Coalition (0.9), Valencian Union (0.4, Reg)" if countryelection == 317
replace string_CPparties = "Other (1.7)" if countryelection == 317
replace string_SCparties = "Basque Nationalist (1.3, Sec), Andalusia Party (0.5, Sec)" if countryelection == 317
replace string_ASparties = "United Left (10.5, RL), Republican Left of Catalonia (0.7, Sec), Basque Solidarity (0.5, Sec), Green Candidates (0.3, Green), Popular Basque Unity (0.7, Sec), Galician Nationalist Bloc (0.9, Sec)" if countryelection == 317

replace voteper_PSparties = 82.9 if countryelection == 317
replace voteper_CPparties =  1.7 if countryelection == 317
replace voteper_SCparties =  1.8 if countryelection == 317
replace voteper_ASparties = 13.6 if countryelection == 317

replace voteper_EL_ASP = .  if countryelection == 317
replace voteper_RL_ASP = 10.5       if countryelection == 317
replace voteper_ER_ASP = .        if countryelection == 317
replace voteper_RR_ASP = .      if countryelection == 317
replace voteper_GREEN_ASP = 0.3    if countryelection == 317
replace voteper_PIRATE_ASP = .     if countryelection == 317
replace voteper_MISC_POP_ASP = .  if countryelection == 317
replace voteper_SEC_NAT_ASP = 2.8   if countryelection == 317
replace voteper_REL_ASP = .      if countryelection == 317
replace voteper_OTHERR_ASP = .   if countryelection == 317
replace voteper_OTHERL_ASP = .    if countryelection == 317

*2000*
replace string_PSparties = "People's Party (44.5), PSOE (34.2), Convergence and Union (4.2, Sec), Canarian Coalition (1.1), Valencian Union (0.3, Reg)" if countryelection == 318
replace string_CPparties = "Other (4.5)" if countryelection == 318
replace string_SCparties = "United Left (5.5, RL), Basque Nationalist (1.5, Sec), Andalusia Party (0.9, Sec)" if countryelection == 318
replace string_ASparties = "Republican Left of Catalonia (0.8, Sec), Basque Solidarity (0.4, Sec), Green Candidates (0.8, Green), Galician Nationalist Bloc (1.3, Sec)" if countryelection == 318

replace voteper_PSparties = 84.3 if countryelection == 318
replace voteper_CPparties =  4.5 if countryelection == 318
replace voteper_SCparties =  7.9 if countryelection == 318
replace voteper_ASparties =  3.3 if countryelection == 318

replace voteper_EL_ASP = .  if countryelection == 318
replace voteper_RL_ASP = .       if countryelection == 318
replace voteper_ER_ASP = .        if countryelection == 318
replace voteper_RR_ASP = .      if countryelection == 318
replace voteper_GREEN_ASP = 0.8    if countryelection == 318
replace voteper_PIRATE_ASP = .     if countryelection == 318
replace voteper_MISC_POP_ASP = .  if countryelection == 318
replace voteper_SEC_NAT_ASP = 2.5   if countryelection == 318
replace voteper_REL_ASP = .      if countryelection == 318
replace voteper_OTHERR_ASP = .   if countryelection == 318
replace voteper_OTHERL_ASP = .    if countryelection == 318

*2004*
replace string_PSparties = "People's Party (37.7), Convergence and Union (3.2, Sec), PSOE (42.3), Canarian Coalition (0.9)" if countryelection == 319
replace string_CPparties = "Other (4.7)" if countryelection == 319
replace string_SCparties = "United Left (5, RL), Basque Nationalist (1.6, Sec), Andalusia Party (0.7, Sec)" if countryelection == 319
replace string_ASparties = "Republican Left of Catalonia (2.5, Sec), Basque Solidarity (0.4, Sec), Galician Nationalist Bloc (0.8, Sec), Navarre Yes (0.2, Sec)" if countryelection == 319

replace voteper_PSparties = 84.1 if countryelection == 319
replace voteper_CPparties =  4.7 if countryelection == 319
replace voteper_SCparties =  7.3 if countryelection == 319
replace voteper_ASparties =  3.9 if countryelection == 319

replace voteper_EL_ASP = .  if countryelection == 319
replace voteper_RL_ASP = .       if countryelection == 319
replace voteper_ER_ASP = .        if countryelection == 319
replace voteper_RR_ASP = .      if countryelection == 319
replace voteper_GREEN_ASP = .    if countryelection == 319
replace voteper_PIRATE_ASP = .     if countryelection == 319
replace voteper_MISC_POP_ASP = .  if countryelection == 319
replace voteper_SEC_NAT_ASP = 3.9   if countryelection == 319
replace voteper_REL_ASP = .      if countryelection == 319
replace voteper_OTHERR_ASP = .   if countryelection == 319
replace voteper_OTHERL_ASP = .    if countryelection == 319

*2008*
replace string_PSparties = "People's Party (39.9), PSOE (43.9), Canarian Coalition (0.7), Convergence and Union (3, Sec), " if countryelection == 320
replace string_CPparties = "Other (3.6), Union, Progress, and Democracy (1.2, OL)" if countryelection == 320
replace string_SCparties = "Republican Left of Catalonia (1.2, Sec), Galician Nationalist Bloc (0.8, Sec), United Left (3.8, RL), Basque Nationalist (1.2, Sec), Andalusia Party (0.3, Sec)" if countryelection == 320
replace string_ASparties = "Basque Solidarity (0.2, Sec), Navarre Yes (0.2, Sec)" if countryelection == 320

replace voteper_PSparties = 87.5 if countryelection == 320
replace voteper_CPparties =  4.8 if countryelection == 320
replace voteper_SCparties =  7.3 if countryelection == 320
replace voteper_ASparties =  0.4 if countryelection == 320

replace voteper_EL_ASP = .  if countryelection == 320
replace voteper_RL_ASP = .       if countryelection == 320
replace voteper_ER_ASP = .        if countryelection == 320
replace voteper_RR_ASP = .      if countryelection == 320
replace voteper_GREEN_ASP = .    if countryelection == 320
replace voteper_PIRATE_ASP = .     if countryelection == 320
replace voteper_MISC_POP_ASP = .  if countryelection == 320
replace voteper_SEC_NAT_ASP = 0.4   if countryelection == 320
replace voteper_REL_ASP = .      if countryelection == 320
replace voteper_OTHERR_ASP = .   if countryelection == 320
replace voteper_OTHERL_ASP = .    if countryelection == 320

*2011*
replace string_PSparties = "People's Party (44.6), PSOE (28.8), Canarian Coalition (0.6)" if countryelection == 321
replace string_CPparties = "Union, Progress, and Democracy (4.7, OL), Other (2.7), Party Against Mistreatment of Animals (0.4, Green), Asturias Forum (0.4)" if countryelection == 321
replace string_SCparties = "Republican Left of Catalonia (1.1, Sec), Galician Nationalist Bloc (0.8, Sec), Convergence and Union (4.2, Sec), Basque Nationalist (1.3, Sec), Andalusia Party (0.3, Sec)" if countryelection == 321
replace string_ASparties = "United Left (6.9, RL), Amaiur (1.4, Sec), Blank Seats (0.4, Misc. Oth), EQUO (0.9, Green), Compromise Coalition (0.5, Sec)" if countryelection == 321

replace voteper_PSparties =  74   if countryelection == 321
replace voteper_CPparties =   8.2 if countryelection == 321
replace voteper_SCparties =  7.7 if countryelection == 321
replace voteper_ASparties =  10.1 if countryelection == 321

replace voteper_EL_ASP = .  if countryelection == 321
replace voteper_RL_ASP = 6.9       if countryelection == 321
replace voteper_ER_ASP = .        if countryelection == 321
replace voteper_RR_ASP = .      if countryelection == 321
replace voteper_GREEN_ASP = 0.9    if countryelection == 321
replace voteper_PIRATE_ASP = .     if countryelection == 321
replace voteper_MISC_POP_ASP = 0.4  if countryelection == 321
replace voteper_SEC_NAT_ASP = 1.9   if countryelection == 321
replace voteper_REL_ASP = .      if countryelection == 321
replace voteper_OTHERR_ASP = .   if countryelection == 321
replace voteper_OTHERL_ASP = .    if countryelection == 321

*2015*
replace string_PSparties = "People's Party (28.7), PSOE (22), Canarian Coalition (0.3)" if countryelection == 322
replace string_CPparties = "Union, Progress, and Democracy (0.6, OL), Other (1.9), Party Against Mistreatment of Animals (0.9, Green), Citizens (13.9, Lib)" if countryelection == 322
replace string_SCparties = "Republican Left of Catalonia (2.4, Sec), Galician Nationalist Bloc (0.3, Sec), Basque Nationalist (1.2, Sec)" if countryelection == 322
replace string_ASparties = "Democracy and Freedom (2.3, Sec), Podemos + (19.2, RL), United Left - Popular Unity (3.7, RL), EH Bildu (0.9, Sec), VOX (0.2, RR), EQUO/ICV (1.5, Green)" if countryelection == 322

replace voteper_PSparties = 51   if countryelection == 322
replace voteper_CPparties = 17.3 if countryelection == 322
replace voteper_SCparties =  3.9 if countryelection == 322
replace voteper_ASparties = 27.7 if countryelection == 322

replace voteper_EL_ASP = .  if countryelection == 322
replace voteper_RL_ASP = 22.9       if countryelection == 322
replace voteper_ER_ASP = .        if countryelection == 322
replace voteper_RR_ASP = 0.2      if countryelection == 322
replace voteper_GREEN_ASP = 1.5    if countryelection == 322
replace voteper_PIRATE_ASP = .     if countryelection == 322
replace voteper_MISC_POP_ASP = .  if countryelection == 322
replace voteper_SEC_NAT_ASP = 3.1   if countryelection == 322
replace voteper_REL_ASP = .      if countryelection == 322
replace voteper_OTHERR_ASP = .   if countryelection == 322
replace voteper_OTHERL_ASP = .    if countryelection == 322

*2016*
replace string_PSparties = "People's Party (33), PSOE (22.6), Canarian Coalition (0.3)" if countryelection == 323
replace string_CPparties = "Union, Progress, and Democracy (0.2, OL), Other (1.1), Party Against Mistreatment of Animals (1.2, Green), Citizens (13.1, Lib)" if countryelection == 323
replace string_SCparties = "Republican Left of Catalonia (2.6, Sec), Galician Nationalist Bloc (0.3, Sec), Basque Nationalist (1.2, Sec)" if countryelection == 323
replace string_ASparties = "Democratic Convergence of Catalonia (2, Sec), Podemos + (19.8, RL), EH Bildu (0.8, Sec), VOX (0.2, RR), EQUO/ICV (1.4, Green), Zero Cuts (0.2, OL)" if countryelection == 323

replace voteper_PSparties = 55.9 if countryelection == 323
replace voteper_CPparties = 15.6 if countryelection == 323
replace voteper_SCparties =  4.1 if countryelection == 323
replace voteper_ASparties = 24.4 if countryelection == 323

replace voteper_EL_ASP = .  if countryelection == 323
replace voteper_RL_ASP = 19.8      if countryelection == 323
replace voteper_ER_ASP = .        if countryelection == 323
replace voteper_RR_ASP = 0.2      if countryelection == 323
replace voteper_GREEN_ASP = 1.4    if countryelection == 323
replace voteper_PIRATE_ASP = .     if countryelection == 323
replace voteper_MISC_POP_ASP = .  if countryelection == 323
replace voteper_SEC_NAT_ASP = 2.8   if countryelection == 323
replace voteper_REL_ASP = .      if countryelection == 323
replace voteper_OTHERR_ASP = .   if countryelection == 323
replace voteper_OTHERL_ASP = 0.2    if countryelection == 323



********************************************************** SWEDEN ****************************************************************

***** Source:  Nohlen (2010) [1952-2006]
*              Valmyndigheten - Swedish Election Authority Website [2010-14] 

*1952*
replace string_PSparties = "SAP (46), People's Party (24.4), Farmer's League (10.7), Moderate Party (14.4)" if countryelection == 324
replace string_CPparties = "Other (0.1)" if countryelection == 324
replace string_SCparties = "NA" if countryelection == 324
replace string_ASparties = "Communist (4.3, EL)" if countryelection == 324

replace voteper_PSparties = 95.5 if countryelection == 324
replace voteper_CPparties = 0.1 if countryelection == 324
replace voteper_SCparties = 0   if countryelection == 324
replace voteper_ASparties = 4.3 if countryelection == 324

replace voteper_EL_ASP = 4.3  if countryelection == 324
replace voteper_RL_ASP = .      if countryelection == 324
replace voteper_ER_ASP = .        if countryelection == 324
replace voteper_RR_ASP = .      if countryelection == 324
replace voteper_GREEN_ASP = .    if countryelection == 324
replace voteper_PIRATE_ASP = .     if countryelection == 324
replace voteper_MISC_POP_ASP = .  if countryelection == 324
replace voteper_SEC_NAT_ASP = .   if countryelection == 324
replace voteper_REL_ASP = .      if countryelection == 324
replace voteper_OTHERR_ASP = .   if countryelection == 324
replace voteper_OTHERL_ASP = .    if countryelection == 324

*1956*
replace string_PSparties = "SAP (44.6), People's Party (23.8), Farmer's League (9.5), Moderate Party (17.1)" if countryelection == 325
replace string_CPparties = "Other (0.1)" if countryelection == 325
replace string_SCparties = "NA" if countryelection == 325
replace string_ASparties = "Communist (5, EL)" if countryelection == 325

replace voteper_PSparties = 95 if countryelection == 325
replace voteper_CPparties = 0.1 if countryelection == 325
replace voteper_SCparties = 0  if countryelection == 325
replace voteper_ASparties = 5.0 if countryelection == 325

replace voteper_EL_ASP = 5 if countryelection == 325
replace voteper_RL_ASP = .      if countryelection == 325
replace voteper_ER_ASP = .        if countryelection == 325
replace voteper_RR_ASP = .      if countryelection == 325
replace voteper_GREEN_ASP = .    if countryelection == 325
replace voteper_PIRATE_ASP = .     if countryelection == 325
replace voteper_MISC_POP_ASP = .  if countryelection == 325
replace voteper_SEC_NAT_ASP = .   if countryelection == 325
replace voteper_REL_ASP = .      if countryelection == 325
replace voteper_OTHERR_ASP = .   if countryelection == 325
replace voteper_OTHERL_ASP = .    if countryelection == 325

*1958*
replace string_PSparties = "SAP (46.2), People's Party (18.2), Farmer's League (12.7), Moderate Party (19.5)" if countryelection == 326
replace string_CPparties = "NA" if countryelection == 326
replace string_SCparties = "NA" if countryelection == 326
replace string_ASparties = "Communist (3.4, EL)" if countryelection == 326

replace voteper_PSparties = 96.6   if countryelection == 326
replace voteper_CPparties = 0   if countryelection == 326
replace voteper_SCparties = 0   if countryelection == 326
replace voteper_ASparties = 3.4 if countryelection == 326

replace voteper_EL_ASP = 3.4 if countryelection == 326
replace voteper_RL_ASP = .      if countryelection == 326
replace voteper_ER_ASP = .        if countryelection == 326
replace voteper_RR_ASP = .      if countryelection == 326
replace voteper_GREEN_ASP = .    if countryelection == 326
replace voteper_PIRATE_ASP = .     if countryelection == 326
replace voteper_MISC_POP_ASP = .  if countryelection == 326
replace voteper_SEC_NAT_ASP = .   if countryelection == 326
replace voteper_REL_ASP = .      if countryelection == 326
replace voteper_OTHERR_ASP = .   if countryelection == 326
replace voteper_OTHERL_ASP = .    if countryelection == 326

*1960*
replace string_PSparties = "SAP (47.8), People's Party (17.5), Farmer's League (13.6), Moderate Party (16.6)" if countryelection == 327
replace string_CPparties = "Other (0.1)" if countryelection == 327
replace string_SCparties = "NA" if countryelection == 327
replace string_ASparties = "Communist (4.5, EL)" if countryelection == 327

replace voteper_PSparties = 95.5    if countryelection == 327
replace voteper_CPparties = 0.1 if countryelection == 327
replace voteper_SCparties = 0   if countryelection == 327
replace voteper_ASparties = 4.5 if countryelection == 327

replace voteper_EL_ASP = 4.5 if countryelection == 327
replace voteper_RL_ASP = .      if countryelection == 327
replace voteper_ER_ASP = .        if countryelection == 327
replace voteper_RR_ASP = .      if countryelection == 327
replace voteper_GREEN_ASP = .    if countryelection == 327
replace voteper_PIRATE_ASP = .     if countryelection == 327
replace voteper_MISC_POP_ASP = .  if countryelection == 327
replace voteper_SEC_NAT_ASP = .   if countryelection == 327
replace voteper_REL_ASP = .      if countryelection == 327
replace voteper_OTHERR_ASP = .   if countryelection == 327
replace voteper_OTHERL_ASP = .    if countryelection == 327

*1964*
replace string_PSparties = "SAP (47.3), People's Party (17), Farmer's League (14.7), Moderate Party (14)" if countryelection == 328
replace string_CPparties = "Christ Democratic Unity (1.8, Rel)" if countryelection == 328
replace string_SCparties = "NA" if countryelection == 328
replace string_ASparties = "Communist (5.2, EL)" if countryelection == 328

replace voteper_PSparties = 93.0 if countryelection == 328
replace voteper_CPparties =  1.8 if countryelection == 328
replace voteper_SCparties =  0   if countryelection == 328
replace voteper_ASparties =  5.2 if countryelection == 328

replace voteper_EL_ASP = 5.2 if countryelection == 328
replace voteper_RL_ASP = .      if countryelection == 328
replace voteper_ER_ASP = .        if countryelection == 328
replace voteper_RR_ASP = .      if countryelection == 328
replace voteper_GREEN_ASP = .    if countryelection == 328
replace voteper_PIRATE_ASP = .     if countryelection == 328
replace voteper_MISC_POP_ASP = .  if countryelection == 328
replace voteper_SEC_NAT_ASP = .   if countryelection == 328
replace voteper_REL_ASP = .      if countryelection == 328
replace voteper_OTHERR_ASP = .   if countryelection == 328
replace voteper_OTHERL_ASP = .    if countryelection == 328

*1968*
replace string_PSparties = "SAP (50.1), People's Party (14.3), Farmer's League (17.4), Moderate Party (13.8)" if countryelection == 329
replace string_CPparties = "Christ Democratic Unity (1.5, Rel)" if countryelection == 329
replace string_SCparties = "NA" if countryelection == 329
replace string_ASparties = "Communist (3, EL)" if countryelection == 329

replace voteper_PSparties = 95.5  if countryelection == 329
replace voteper_CPparties = 1.5 if countryelection == 329
replace voteper_SCparties = 0   if countryelection == 329
replace voteper_ASparties = 3   if countryelection == 329

replace voteper_EL_ASP = 3 if countryelection == 329
replace voteper_RL_ASP = .      if countryelection == 329
replace voteper_ER_ASP = .        if countryelection == 329
replace voteper_RR_ASP = .      if countryelection == 329
replace voteper_GREEN_ASP = .    if countryelection == 329
replace voteper_PIRATE_ASP = .     if countryelection == 329
replace voteper_MISC_POP_ASP = .  if countryelection == 329
replace voteper_SEC_NAT_ASP = .   if countryelection == 329
replace voteper_REL_ASP = .      if countryelection == 329
replace voteper_OTHERR_ASP = .   if countryelection == 329
replace voteper_OTHERL_ASP = .    if countryelection == 329

*1970*
replace string_PSparties = "SAP (45.3), People's Party (16.2), Farmer's League (19.9), Moderate Party (11.5)" if countryelection == 330
replace string_CPparties = "Christ Democratic Unity (1.8, Rel)" if countryelection == 330
replace string_SCparties = "NA" if countryelection == 330
replace string_ASparties = "Left Party (4.8, EL), Communist-ML (0.4, EL)" if countryelection == 330

replace voteper_PSparties = 92.9    if countryelection == 330
replace voteper_CPparties = 1.8 if countryelection == 330
replace voteper_SCparties = 0   if countryelection == 330
replace voteper_ASparties = 5.2 if countryelection == 330

replace voteper_EL_ASP = 5.2 if countryelection == 330
replace voteper_RL_ASP = .      if countryelection == 330
replace voteper_ER_ASP = .        if countryelection == 330
replace voteper_RR_ASP = .      if countryelection == 330
replace voteper_GREEN_ASP = .    if countryelection == 330
replace voteper_PIRATE_ASP = .     if countryelection == 330
replace voteper_MISC_POP_ASP = .  if countryelection == 330
replace voteper_SEC_NAT_ASP = .   if countryelection == 330
replace voteper_REL_ASP = .      if countryelection == 330
replace voteper_OTHERR_ASP = .   if countryelection == 330
replace voteper_OTHERL_ASP = .    if countryelection == 330

*1973*
replace string_PSparties = "SAP (43.6), People's Party (9.4), Farmer's League (25.1), Moderate Party (14.3)" if countryelection == 331
replace string_CPparties = "Christ Democratic Unity (1.8, Rel)" if countryelection == 331
replace string_SCparties = "NA" if countryelection == 331
replace string_ASparties = "Left Party (5.3, EL), Communist-ML (0.2, EL), Communist (0.4, EL)" if countryelection == 331

replace voteper_PSparties = 92.4 if countryelection == 331
replace voteper_CPparties =  1.8 if countryelection == 331
replace voteper_SCparties =  0   if countryelection == 331
replace voteper_ASparties =  5.9 if countryelection == 331

replace voteper_EL_ASP = 5.9    if countryelection == 331
replace voteper_RL_ASP = .      if countryelection == 331
replace voteper_ER_ASP = .        if countryelection == 331
replace voteper_RR_ASP = .      if countryelection == 331
replace voteper_GREEN_ASP = .    if countryelection == 331
replace voteper_PIRATE_ASP = .     if countryelection == 331
replace voteper_MISC_POP_ASP = .  if countryelection == 331
replace voteper_SEC_NAT_ASP = .   if countryelection == 331
replace voteper_REL_ASP = .      if countryelection == 331
replace voteper_OTHERR_ASP = .   if countryelection == 331
replace voteper_OTHERL_ASP = .    if countryelection == 331

*1976*
replace string_PSparties = "SAP (42.7), People's Party (11.1), Farmer's League (24.1), Moderate Party (15.6)" if countryelection == 332
replace string_CPparties = "Christ Democratic Unity (1.4, Rel), Other Parties (0.1, Oth)" if countryelection == 332
replace string_SCparties = "NA" if countryelection == 332
replace string_ASparties = "Left Party (4.8, Com), Communist (0.3, Com)" if countryelection == 332

replace voteper_PSparties = 93.5 if countryelection == 332
replace voteper_CPparties = 1.5 if countryelection == 332
replace voteper_SCparties = 0   if countryelection == 332
replace voteper_ASparties = 5.1 if countryelection == 332

replace voteper_EL_ASP = 5.1 if countryelection == 332
replace voteper_RL_ASP = .      if countryelection == 332
replace voteper_ER_ASP = .        if countryelection == 332
replace voteper_RR_ASP = .      if countryelection == 332
replace voteper_GREEN_ASP = .    if countryelection == 332
replace voteper_PIRATE_ASP = .     if countryelection == 332
replace voteper_MISC_POP_ASP = .  if countryelection == 332
replace voteper_SEC_NAT_ASP = .   if countryelection == 332
replace voteper_REL_ASP = .      if countryelection == 332
replace voteper_OTHERR_ASP = .   if countryelection == 332
replace voteper_OTHERL_ASP = .    if countryelection == 332

*1979*
replace string_PSparties = "SAP (43.2), People's Party (10.6), Farmer's League (18.1), Moderate Party (20.3)" if countryelection == 333
replace string_CPparties = "Christ Democratic Unity (1.4, Rel), Other Parties (0.4, Oth)" if countryelection == 333
replace string_SCparties = "NA" if countryelection == 333
replace string_ASparties = "Left Party (5.6, Com), Worker's Communist (0.2, Com), Communist (0.2, Com)" if countryelection == 333

replace voteper_PSparties = 92.2 if countryelection == 333
replace voteper_CPparties =  1.8 if countryelection == 333
replace voteper_SCparties =  0   if countryelection == 333
replace voteper_ASparties =  6   if countryelection == 333

replace voteper_EL_ASP = 6 if countryelection == 333
replace voteper_RL_ASP = .      if countryelection == 333
replace voteper_ER_ASP = .        if countryelection == 333
replace voteper_RR_ASP = .      if countryelection == 333
replace voteper_GREEN_ASP = .    if countryelection == 333
replace voteper_PIRATE_ASP = .     if countryelection == 333
replace voteper_MISC_POP_ASP = .  if countryelection == 333
replace voteper_SEC_NAT_ASP = .   if countryelection == 333
replace voteper_REL_ASP = .      if countryelection == 333
replace voteper_OTHERR_ASP = .   if countryelection == 333
replace voteper_OTHERL_ASP = .    if countryelection == 333

*1982*
replace string_PSparties = "SAP (45.6), People's Party (5.9), Farmer's League (15.5), Moderate Party (23.6)" if countryelection == 334
replace string_CPparties = "Christ Democratic Unity (1.9, Rel), Other Parties (0.2, Oth)" if countryelection == 334
replace string_SCparties = "NA" if countryelection == 334
replace string_ASparties = "Left Party (5.6, Com), Worker's Communist (0.1, Com), Green Party (1.7, Green)" if countryelection == 334

replace voteper_PSparties = 90.6 if countryelection == 334
replace voteper_CPparties =  2.1 if countryelection == 334
replace voteper_SCparties =  0   if countryelection == 334
replace voteper_ASparties =  7.4 if countryelection == 334

replace voteper_EL_ASP = 5.7 if countryelection == 334
replace voteper_RL_ASP = .      if countryelection == 334
replace voteper_ER_ASP = .        if countryelection == 334
replace voteper_RR_ASP = .      if countryelection == 334
replace voteper_GREEN_ASP = 1.7    if countryelection == 334
replace voteper_PIRATE_ASP = .     if countryelection == 334
replace voteper_MISC_POP_ASP = .  if countryelection == 334
replace voteper_SEC_NAT_ASP = .   if countryelection == 334
replace voteper_REL_ASP = .      if countryelection == 334
replace voteper_OTHERR_ASP = .   if countryelection == 334
replace voteper_OTHERL_ASP = .    if countryelection == 334

*1985*
replace string_PSparties = "SAP (44.7), People's Party (14.2), Farmer's League (12.5), Moderate Party (21.3), Christ Democratic Unity (1.9, Rel)" if countryelection == 335
replace string_CPparties = "Other Parties (0.4, Oth)" if countryelection == 335
replace string_SCparties = "NA" if countryelection == 335
replace string_ASparties = "Left Party (5.4, Com), Green Party (1.4, Green)" if countryelection == 335

replace voteper_PSparties = 92.7 if countryelection == 335
replace voteper_CPparties =  0.4 if countryelection == 335
replace voteper_SCparties =  0   if countryelection == 335
replace voteper_ASparties =  6.8 if countryelection == 335

replace voteper_EL_ASP = 5.4 if countryelection == 335
replace voteper_RL_ASP = .      if countryelection == 335
replace voteper_ER_ASP = .        if countryelection == 335
replace voteper_RR_ASP = .      if countryelection == 335
replace voteper_GREEN_ASP = 1.4    if countryelection == 335
replace voteper_PIRATE_ASP = .     if countryelection == 335
replace voteper_MISC_POP_ASP = .  if countryelection == 335
replace voteper_SEC_NAT_ASP = .   if countryelection == 335
replace voteper_REL_ASP = .      if countryelection == 335
replace voteper_OTHERR_ASP = .   if countryelection == 335
replace voteper_OTHERL_ASP = .    if countryelection == 335

*1988*
replace string_PSparties = "SAP (43.2), People's Party (12.2), Farmer's League (11.3), Christ Democratic Unity (2.9), Moderate Party (18.3)" if countryelection == 336
replace string_CPparties = "Other Parties (0.7, Oth)" if countryelection == 336
replace string_SCparties = "NA" if countryelection == 336
replace string_ASparties = "Left Party (5.8, Com), Green Party (5.5, Green)" if countryelection == 336

replace voteper_PSparties = 87.9 if countryelection == 336
replace voteper_CPparties =  0.7 if countryelection == 336
replace voteper_SCparties =  0   if countryelection == 336
replace voteper_ASparties = 11.3 if countryelection == 336

replace voteper_EL_ASP = 5.8 if countryelection == 336
replace voteper_RL_ASP = .      if countryelection == 336
replace voteper_ER_ASP = .        if countryelection == 336
replace voteper_RR_ASP = .      if countryelection == 336
replace voteper_GREEN_ASP = 5.5    if countryelection == 336
replace voteper_PIRATE_ASP = .     if countryelection == 336
replace voteper_MISC_POP_ASP = .  if countryelection == 336
replace voteper_SEC_NAT_ASP = .   if countryelection == 336
replace voteper_REL_ASP = .      if countryelection == 336
replace voteper_OTHERR_ASP = .   if countryelection == 336
replace voteper_OTHERL_ASP = .    if countryelection == 336

*1991*
replace string_PSparties = "SAP (37.7), People's Party (9.1), Farmer's League (8.5), Christ Democratic Unity (7.1), Moderate Party (21.9)" if countryelection == 337
replace string_CPparties = "Other Parties (1, Oth)" if countryelection == 337
replace string_SCparties = "NA" if countryelection == 337
replace string_ASparties = "Left Party (4.5, RL), Green Party (3.4, Green), New Democracy (6.8, RR)" if countryelection == 337

replace voteper_PSparties = 84.3 if countryelection == 337
replace voteper_CPparties =  1   if countryelection == 337
replace voteper_SCparties =  0   if countryelection == 337
replace voteper_ASparties = 14.7 if countryelection == 337

replace voteper_EL_ASP = . if countryelection == 337
replace voteper_RL_ASP = 4.5      if countryelection == 337
replace voteper_ER_ASP = .        if countryelection == 337
replace voteper_RR_ASP = 6.8      if countryelection == 337
replace voteper_GREEN_ASP = 3.4    if countryelection == 337
replace voteper_PIRATE_ASP = .     if countryelection == 337
replace voteper_MISC_POP_ASP = .  if countryelection == 337
replace voteper_SEC_NAT_ASP = .   if countryelection == 337
replace voteper_REL_ASP = .      if countryelection == 337
replace voteper_OTHERR_ASP = .   if countryelection == 337
replace voteper_OTHERL_ASP = .    if countryelection == 337

*1994*
replace string_PSparties = "SAP (45.3), People's Party (7.2), Farmer's League (7.7), Christ Democratic Unity (4.1), Moderate Party (22.4)" if countryelection == 338
replace string_CPparties = "Other Parties (1, Oth)" if countryelection == 338
replace string_SCparties = "NA" if countryelection == 338
replace string_ASparties = "Left Party (6.2, RL), Green Party (5, Green), New Democracy (1.2, RR)" if countryelection == 338

replace voteper_PSparties = 86.7 if countryelection == 338
replace voteper_CPparties =  1   if countryelection == 338
replace voteper_SCparties =  0   if countryelection == 338
replace voteper_ASparties = 12.4 if countryelection == 338

replace voteper_EL_ASP = . if countryelection == 338
replace voteper_RL_ASP = 6.2      if countryelection == 338
replace voteper_ER_ASP = .        if countryelection == 338
replace voteper_RR_ASP = 1.2      if countryelection == 338
replace voteper_GREEN_ASP = 5   if countryelection == 338
replace voteper_PIRATE_ASP = .     if countryelection == 338
replace voteper_MISC_POP_ASP = .  if countryelection == 338
replace voteper_SEC_NAT_ASP = .   if countryelection == 338
replace voteper_REL_ASP = .      if countryelection == 338
replace voteper_OTHERR_ASP = .   if countryelection == 338
replace voteper_OTHERL_ASP = .    if countryelection == 338

*1998*
replace string_PSparties = "SAP (36.4), People's Party (4.7), Farmer's League (5.1), Christ Democratic Unity (11.8), Moderate Party (22.9)" if countryelection == 339
replace string_CPparties = "Other Parties (0.6, Oth), Pensioners Party (1, Pens)" if countryelection == 339
replace string_SCparties = "NA" if countryelection == 339
replace string_ASparties = "Left Party (12, RL), Green Party (4.5, Green), New Democracy (0.2, RR), New Party (0.5, RR) Sweden Democrats (0.4, RR)" if countryelection == 339

replace voteper_PSparties = 80.9 if countryelection == 339
replace voteper_CPparties =  1.6 if countryelection == 339
replace voteper_SCparties =  0   if countryelection == 339
replace voteper_ASparties = 17.6 if countryelection == 339

replace voteper_EL_ASP = . if countryelection == 339
replace voteper_RL_ASP = 12      if countryelection == 339
replace voteper_ER_ASP = .        if countryelection == 339
replace voteper_RR_ASP = 1.1      if countryelection == 339
replace voteper_GREEN_ASP = 4.5    if countryelection == 339
replace voteper_PIRATE_ASP = .     if countryelection == 339
replace voteper_MISC_POP_ASP = .  if countryelection == 339
replace voteper_SEC_NAT_ASP = .   if countryelection == 339
replace voteper_REL_ASP = .      if countryelection == 339
replace voteper_OTHERR_ASP = .   if countryelection == 339
replace voteper_OTHERL_ASP = .    if countryelection == 339

*2002*
replace string_PSparties = "SAP (39.9), People's Party (13.4), Farmer's League (6.2), Christ Democratic Unity (9.1), Moderate Party (15.3)" if countryelection == 340
replace string_CPparties = "Other Parties (1, Oth), Pensioners Party (0.7, Pens)" if countryelection == 340
replace string_SCparties = "Left Party (8.4, RL), Green Party (4.6, Green)" if countryelection == 340
replace string_ASparties = "Sweden Democrats (1.4, RR)" if countryelection == 340

replace voteper_PSparties = 83.9 if countryelection == 340
replace voteper_CPparties =  1.7 if countryelection == 340
replace voteper_SCparties = 13   if countryelection == 340
replace voteper_ASparties =  1.4 if countryelection == 340

replace voteper_EL_ASP = . if countryelection == 340
replace voteper_RL_ASP = .      if countryelection == 340
replace voteper_ER_ASP = .        if countryelection == 340
replace voteper_RR_ASP = 1.4      if countryelection == 340
replace voteper_GREEN_ASP = .    if countryelection == 340
replace voteper_PIRATE_ASP = .     if countryelection == 340
replace voteper_MISC_POP_ASP = .  if countryelection == 340
replace voteper_SEC_NAT_ASP = .   if countryelection == 340
replace voteper_REL_ASP = .      if countryelection == 340
replace voteper_OTHERR_ASP = .   if countryelection == 340
replace voteper_OTHERL_ASP = .    if countryelection == 340

*2006*
replace string_PSparties = "SAP (35), People's Party (7.5), Farmer's League (7.9), Christ Democratic Unity (6.6), Moderate Party (26.2)" if countryelection == 341
replace string_CPparties = "Other Parties (0.4, Oth), Pensioners Party (0.6, Pens)" if countryelection == 341
replace string_SCparties = "Left Party (5.8, RL), Green Party (5.2, Green)" if countryelection == 341
replace string_ASparties = "Sweden Democrats (2.9, RR), Feminist Intiative (0.7, OL), Pirate Party (0.6, PP), June List (0.5, MISC.POP)" if countryelection == 341

replace voteper_PSparties = 83.2 if countryelection == 341
replace voteper_CPparties =  1   if countryelection == 341
replace voteper_SCparties = 11   if countryelection == 341
replace voteper_ASparties =  4.7 if countryelection == 341

replace voteper_EL_ASP = . if countryelection == 341
replace voteper_RL_ASP = .      if countryelection == 341
replace voteper_ER_ASP = .        if countryelection == 341
replace voteper_RR_ASP = 2.9      if countryelection == 341
replace voteper_GREEN_ASP = .    if countryelection == 341
replace voteper_PIRATE_ASP = 0.6     if countryelection == 341
replace voteper_MISC_POP_ASP = 0.5  if countryelection == 341
replace voteper_SEC_NAT_ASP = .   if countryelection == 341
replace voteper_REL_ASP = .      if countryelection == 341
replace voteper_OTHERR_ASP = .   if countryelection == 341
replace voteper_OTHERL_ASP = 0.7    if countryelection == 341

*2010*
replace string_PSparties = "SAP (30.7), People's Party (7.1), Farmer's League (6.6), Christ Democratic Unity (5.6), Moderate Party (30.1), Green Party (7.3, Green)" if countryelection == 342
replace string_CPparties = "Other Parties (0.1, Oth), Pensioners Party (0.2, Pens)" if countryelection == 342
replace string_SCparties = "Left Party (5.6, RL)" if countryelection == 342
replace string_ASparties = "Sweden Democrats (5.7, RR), Feminist Intiative (0.4, OL), Pirate Party (0.7, Pirat)" if countryelection == 342

replace voteper_PSparties = 87.4 if countryelection == 342
replace voteper_CPparties =  0.3 if countryelection == 342
replace voteper_SCparties =  5.6 if countryelection == 342
replace voteper_ASparties =  6.8 if countryelection == 342

replace voteper_EL_ASP = . if countryelection == 342
replace voteper_RL_ASP = .      if countryelection == 342
replace voteper_ER_ASP = .        if countryelection == 342
replace voteper_RR_ASP = 5.7      if countryelection == 342
replace voteper_GREEN_ASP = .    if countryelection == 342
replace voteper_PIRATE_ASP = 0.7     if countryelection == 342
replace voteper_MISC_POP_ASP = .  if countryelection == 342
replace voteper_SEC_NAT_ASP = .   if countryelection == 342
replace voteper_REL_ASP = .      if countryelection == 342
replace voteper_OTHERR_ASP = .   if countryelection == 342
replace voteper_OTHERL_ASP = 0.4    if countryelection == 342

*2014*
replace string_PSparties = "SAP (31), People's Party (5.4), Farmer's League (6.1), Christ Democratic Unity (4.6), Moderate Party (23.3), Green Party (6.9, Green)" if countryelection == 343
replace string_CPparties = "Other Parties (0.4, Oth), Pensioners Party (0.2, Pens)" if countryelection == 343
replace string_SCparties = "Left Party (5.7, RL)" if countryelection == 343
replace string_ASparties = "Sweden Democrats (12.9, RR), Feminist Intiative (3.1, OL), Pirate Party (0.4, Pirat)" if countryelection == 343

replace voteper_PSparties = 77.3 if countryelection == 343
replace voteper_CPparties =  0.6 if countryelection == 343
replace voteper_SCparties =  5.7 if countryelection == 343
replace voteper_ASparties = 16.4 if countryelection == 343

replace voteper_EL_ASP = . if countryelection == 343
replace voteper_RL_ASP = .      if countryelection == 343
replace voteper_ER_ASP = .        if countryelection == 343
replace voteper_RR_ASP = 12.9      if countryelection == 343
replace voteper_GREEN_ASP = .    if countryelection == 343
replace voteper_PIRATE_ASP = 0.4     if countryelection == 343
replace voteper_MISC_POP_ASP = .  if countryelection == 343
replace voteper_SEC_NAT_ASP = .   if countryelection == 343
replace voteper_REL_ASP = .      if countryelection == 343
replace voteper_OTHERR_ASP = .   if countryelection == 343
replace voteper_OTHERL_ASP = 3.1    if countryelection == 343



****************************************************** SWITZERLAND *****************************************************

***** Source:  Nohlen (2010) [1951-2007]
*              Bundesamt für Statistik - Swiss Federal Statistical Office [2011-15] 


*1951*
replace string_PSparties = "SDP (26), FDP (24), CVP (22.5), SVP (12.6), EVP (1)" if countryelection == 344
replace string_CPparties = "Liberal Democratic (2.6, Lib), Social Political Group (2.2, LW), Liberal-Socialists (0.9, LW), Others (0.5, Oth)" if countryelection == 344
replace string_SCparties = "NA" if countryelection == 344
replace string_ASparties = "Party of Labour (2.7, EL), Ring of Independents (5.1, OR)" if countryelection == 344

replace voteper_PSparties = 86.1 if countryelection == 344
replace voteper_CPparties =  6.2 if countryelection == 344
replace voteper_SCparties =  0   if countryelection == 344
replace voteper_ASparties =  7.8 if countryelection == 344

replace voteper_EL_ASP = 2.7 if countryelection == 344
replace voteper_RL_ASP = .      if countryelection == 344
replace voteper_ER_ASP = .        if countryelection == 344
replace voteper_RR_ASP = .      if countryelection == 344
replace voteper_GREEN_ASP = .    if countryelection == 344
replace voteper_PIRATE_ASP = .     if countryelection == 344
replace voteper_MISC_POP_ASP = .  if countryelection == 344
replace voteper_SEC_NAT_ASP = .   if countryelection == 344
replace voteper_REL_ASP = .      if countryelection == 344
replace voteper_OTHERR_ASP = 5.1   if countryelection == 344
replace voteper_OTHERL_ASP = .    if countryelection == 344

*1955*
replace string_PSparties = "SDP (27), FDP (23.3), CVP (23.2), SVP (12.1), EVP (1.1)" if countryelection == 345
replace string_CPparties = "Liberal Democratic (2.2, Lib), Social Political Group (2.2, LW), Liberal-Socialists (0.4, LW), Others (0.5, Oth)" if countryelection == 345
replace string_SCparties = "NA" if countryelection == 345
replace string_ASparties = "Party of Labour (2.6, EL), Ring of Independents (5.5, OR)" if countryelection == 345

replace voteper_PSparties = 86.7 if countryelection == 345
replace voteper_CPparties =  5.3 if countryelection == 345
replace voteper_SCparties =  0   if countryelection == 345
replace voteper_ASparties =  8.1 if countryelection == 345

replace voteper_EL_ASP = 2.6 if countryelection == 345
replace voteper_RL_ASP = .      if countryelection == 345
replace voteper_ER_ASP = .        if countryelection == 345
replace voteper_RR_ASP = .      if countryelection == 345
replace voteper_GREEN_ASP = .    if countryelection == 345
replace voteper_PIRATE_ASP = .     if countryelection == 345
replace voteper_MISC_POP_ASP = .  if countryelection == 345
replace voteper_SEC_NAT_ASP = .   if countryelection == 345
replace voteper_REL_ASP = .      if countryelection == 345
replace voteper_OTHERR_ASP = 5.5   if countryelection == 345
replace voteper_OTHERL_ASP = .    if countryelection == 345

*1959*
replace string_PSparties = "SDP (26.4), FDP (23.7), CVP (23.3), SVP (11.6), EVP (1.4)" if countryelection == 346
replace string_CPparties = "Liberal Democratic (2.3, Lib), Social Political Group (2.2, LW), Others (1, Oth)" if countryelection == 346
replace string_SCparties = "NA" if countryelection == 346
replace string_ASparties = "Party of Labour (2.7, EL), Ring of Independents (5.5, OR)" if countryelection == 346

replace voteper_PSparties = 86.4 if countryelection == 346
replace voteper_CPparties =  5.5 if countryelection == 346
replace voteper_SCparties =  0   if countryelection == 346
replace voteper_ASparties =  8.2 if countryelection == 346

replace voteper_EL_ASP = 2.7 if countryelection == 346
replace voteper_RL_ASP = .      if countryelection == 346
replace voteper_ER_ASP = .        if countryelection == 346
replace voteper_RR_ASP = .      if countryelection == 346
replace voteper_GREEN_ASP = .    if countryelection == 346
replace voteper_PIRATE_ASP = .     if countryelection == 346
replace voteper_MISC_POP_ASP = .  if countryelection == 346
replace voteper_SEC_NAT_ASP = .   if countryelection == 346
replace voteper_REL_ASP = .      if countryelection == 346
replace voteper_OTHERR_ASP = 5.5   if countryelection == 346
replace voteper_OTHERL_ASP = .    if countryelection == 346

*1963*
replace string_PSparties = "SDP (26.6), FDP (23.9), CVP (23.4), SVP (11.4), EVP (1.6)" if countryelection == 347
replace string_CPparties = "Liberal Democratic (2.2, Lib), Social Political Group (1.8, LW), Others (1.8, Oth)" if countryelection == 347
replace string_SCparties = "NA" if countryelection == 347
replace string_ASparties = "Party of Labour (2.2, EL), Ring of Independents (5, OR)" if countryelection == 347

replace voteper_PSparties = 86.9 if countryelection == 347
replace voteper_CPparties =  5.8   if countryelection == 347
replace voteper_SCparties =  0   if countryelection == 347
replace voteper_ASparties =  7.2 if countryelection == 347

replace voteper_EL_ASP = 2.2 if countryelection == 347
replace voteper_RL_ASP = .      if countryelection == 347
replace voteper_ER_ASP = .        if countryelection == 347
replace voteper_RR_ASP = .      if countryelection == 347
replace voteper_GREEN_ASP = .    if countryelection == 347
replace voteper_PIRATE_ASP = .     if countryelection == 347
replace voteper_MISC_POP_ASP = .  if countryelection == 347
replace voteper_SEC_NAT_ASP = .   if countryelection == 347
replace voteper_REL_ASP = .      if countryelection == 347
replace voteper_OTHERR_ASP = 5   if countryelection == 347
replace voteper_OTHERL_ASP = .    if countryelection == 347

*1967*
replace string_PSparties = "SDP (23.5), FDP (23.2), CVP (22.1), SVP (11), EVP (1.4)" if countryelection == 348
replace string_CPparties = "Liberal Democratic (2.3, Lib), Social Political Group (1.4, LW), Others (2.2, Oth)" if countryelection == 348
replace string_SCparties = "NA" if countryelection == 348
replace string_ASparties = "Party of Labour (2.9, Com), Ring of Independents (9.1, OR), National Action (0.6, RR), Republican Movement (0.2, RR)" if countryelection == 348

replace voteper_PSparties = 81.2 if countryelection == 348
replace voteper_CPparties =  5.9 if countryelection == 348
replace voteper_SCparties =  0   if countryelection == 348
replace voteper_ASparties = 12.8 if countryelection == 348

replace voteper_EL_ASP = 2.9 if countryelection == 348
replace voteper_RL_ASP = .      if countryelection == 348
replace voteper_ER_ASP = .        if countryelection == 348
replace voteper_RR_ASP = 0.8      if countryelection == 348
replace voteper_GREEN_ASP = .    if countryelection == 348
replace voteper_PIRATE_ASP = .     if countryelection == 348
replace voteper_MISC_POP_ASP = .  if countryelection == 348
replace voteper_SEC_NAT_ASP = .   if countryelection == 348
replace voteper_REL_ASP = .      if countryelection == 348
replace voteper_OTHERR_ASP = 9.1   if countryelection == 348
replace voteper_OTHERL_ASP = .    if countryelection == 348

*1971*
replace string_PSparties = "SDP (22.9), FDP (21.7), CVP (20.4), SVP (11.1), EVP (2.1)" if countryelection == 349
replace string_CPparties = "Liberal Democratic (2.2, Lib), Christian Social Party (0.3, Rel), Others (1.2, Oth)" if countryelection == 349
replace string_SCparties = "NA" if countryelection == 349
replace string_ASparties = "Party of Labour (2.6, Com), POCH (0.1, Com), Autonomous Socialist (0.3, Com), Ring of Independents (7.6, OR), National Action (3.2, RR), Republican Movement (4.3, RR)" if countryelection == 349

replace voteper_PSparties = 78.2 if countryelection == 349
replace voteper_CPparties =  3.7 if countryelection == 349
replace voteper_SCparties =  0   if countryelection == 349
replace voteper_ASparties = 18.1 if countryelection == 349

replace voteper_EL_ASP = 3 if countryelection == 349
replace voteper_RL_ASP = .      if countryelection == 349
replace voteper_ER_ASP = .        if countryelection == 349
replace voteper_RR_ASP = 7.5      if countryelection == 349
replace voteper_GREEN_ASP = .    if countryelection == 349
replace voteper_PIRATE_ASP = .     if countryelection == 349
replace voteper_MISC_POP_ASP = .  if countryelection == 349
replace voteper_SEC_NAT_ASP = .   if countryelection == 349
replace voteper_REL_ASP = .      if countryelection == 349
replace voteper_OTHERR_ASP = 7.6   if countryelection == 349
replace voteper_OTHERL_ASP = .    if countryelection == 349

*1975*
replace string_PSparties = "SDP (24.9), FDP (22.2), CVP (21.1), SVP (9.9), EVP (2)" if countryelection == 350
replace string_CPparties = "Liberal Democratic (2.4, Lib), Others (1.9, Oth)" if countryelection == 350
replace string_SCparties = "NA" if countryelection == 350
replace string_ASparties = "Party of Labour (2.4, EL), POCH (1, EL), Green (0.1, Green), Autonomous Socialist (0.3, EL), Ring of Independents (6.1, OR), Federal Democratic Union (0.3, RR), National Action (2.5, RR), Republican Movement (3, RR)" if countryelection == 350

replace voteper_PSparties = 80.1 if countryelection == 350
replace voteper_CPparties =  4.3 if countryelection == 350
replace voteper_SCparties =  0   if countryelection == 350
replace voteper_ASparties = 15.7 if countryelection == 350

replace voteper_EL_ASP = 3.7 if countryelection == 350
replace voteper_RL_ASP = .      if countryelection == 350
replace voteper_ER_ASP = .        if countryelection == 350
replace voteper_RR_ASP = 5.8      if countryelection == 350
replace voteper_GREEN_ASP = 0.1    if countryelection == 350
replace voteper_PIRATE_ASP = .     if countryelection == 350
replace voteper_MISC_POP_ASP = .  if countryelection == 350
replace voteper_SEC_NAT_ASP = .   if countryelection == 350
replace voteper_REL_ASP = .      if countryelection == 350
replace voteper_OTHERR_ASP = 6.1   if countryelection == 350
replace voteper_OTHERL_ASP = .    if countryelection == 350

*1979*
replace string_PSparties = "SDP (24.4), FDP (24), CVP (21.3), SVP (11.6), EVP (2.2)" if countryelection == 351
replace string_CPparties = "Green (0.6, Green), Liberal Democratic (2.8, Lib), Others (2.3, Oth)" if countryelection == 351
replace string_SCparties = "NA" if countryelection == 351
replace string_ASparties = "Green Alternative (0.2, Green), Party of Labour (2.1, Com), POCH (1.7, Com), Autonomous Socialist (0.4, Com), Ring of Independents (4.1, OR), Federal Democratic Union (0.3, RR), National Action (1.3, RR), Republican Movement (0.6, RR)" if countryelection == 351

replace voteper_PSparties = 83.5 if countryelection == 351
replace voteper_CPparties =  5.7 if countryelection == 351
replace voteper_SCparties =  0   if countryelection == 351
replace voteper_ASparties = 10.7 if countryelection == 351

replace voteper_EL_ASP = 4.2 if countryelection == 351
replace voteper_RL_ASP = .      if countryelection == 351
replace voteper_ER_ASP = .        if countryelection == 351
replace voteper_RR_ASP = 2.2      if countryelection == 351
replace voteper_GREEN_ASP = 0.2    if countryelection == 351
replace voteper_PIRATE_ASP = .     if countryelection == 351
replace voteper_MISC_POP_ASP = .  if countryelection == 351
replace voteper_SEC_NAT_ASP = .   if countryelection == 351
replace voteper_REL_ASP = .      if countryelection == 351
replace voteper_OTHERR_ASP = 4.1   if countryelection == 351
replace voteper_OTHERL_ASP = .    if countryelection == 351

*1983*
replace string_PSparties = "SDP (22.8), FDP (23.3), CVP (20.2), SVP (11.1), EVP (2.1)" if countryelection == 352
replace string_CPparties = "Green (1.9, Green), Liberal Democratic (2.8, Lib), Christian Social Party (0.4, Rel), Others (3.1, Oth)" if countryelection == 352
replace string_SCparties = "NA" if countryelection == 352
replace string_ASparties = "Green Alternative (1, Green), Party of Labour (0.9, Com), POCH (2.2, Com), Autonomous Socialist (0.5, Com), Ring of Independents (4, OR), Federal Democratic Union (0.4, RR), National Action (2.9, RR), Republican Movement (0.5, RR)" if countryelection == 352

replace voteper_PSparties = 79.5 if countryelection == 352
replace voteper_CPparties =  8.2 if countryelection == 352
replace voteper_SCparties =  0   if countryelection == 352
replace voteper_ASparties = 12.4 if countryelection == 352

replace voteper_EL_ASP = 3.6 if countryelection == 352
replace voteper_RL_ASP = .      if countryelection == 352
replace voteper_ER_ASP = .        if countryelection == 352
replace voteper_RR_ASP = 3.8      if countryelection == 352
replace voteper_GREEN_ASP = 1    if countryelection == 352
replace voteper_PIRATE_ASP = .     if countryelection == 352
replace voteper_MISC_POP_ASP = .  if countryelection == 352
replace voteper_SEC_NAT_ASP = .   if countryelection == 352
replace voteper_REL_ASP = .      if countryelection == 352
replace voteper_OTHERR_ASP = 4   if countryelection == 352
replace voteper_OTHERL_ASP = .    if countryelection == 352

*1987*
replace string_PSparties = "SDP (18.4), FDP (22.9), CVP (19.6), SVP (11), EVP (1.9)" if countryelection == 353
replace string_CPparties = "Green (4.9, Green), Liberal Democratic (2.7, Lib), Christian Social Party (0.3, Rel), Others (2.6, Oth)" if countryelection == 353
replace string_SCparties = "NA" if countryelection == 353
replace string_ASparties = "Green Alternative (2.4, Green), Party of Labour (0.8, Com), POCH (1.3, Com), Autonomous Socialist (0.6, Com), Ring of Independents (4.2, OR), Federal Democratic Union (0.9, RR), National Action (2.5, RR), Swiss Motorists (2.6, RR), Republican Movement (0.3, RR)" if countryelection == 353

replace voteper_PSparties = 73.8 if countryelection == 353
replace voteper_CPparties = 10.5 if countryelection == 353
replace voteper_SCparties =  0   if countryelection == 353
replace voteper_ASparties = 15.6 if countryelection == 353

replace voteper_EL_ASP = 2.7 if countryelection == 353
replace voteper_RL_ASP = .      if countryelection == 353
replace voteper_ER_ASP = .        if countryelection == 353
replace voteper_RR_ASP = 6.3      if countryelection == 353
replace voteper_GREEN_ASP = 2.4    if countryelection == 353
replace voteper_PIRATE_ASP = .     if countryelection == 353
replace voteper_MISC_POP_ASP = .  if countryelection == 353
replace voteper_SEC_NAT_ASP = .   if countryelection == 353
replace voteper_REL_ASP = .      if countryelection == 353
replace voteper_OTHERR_ASP = 4.2   if countryelection == 353
replace voteper_OTHERL_ASP = .    if countryelection == 353

*1991*
replace string_PSparties = "SDP (18.5), FDP (21), CVP (18), SVP (11.9), EVP (1.9)" if countryelection == 354
replace string_CPparties = "Green (6.1, Green), Liberal Democratic (3, Lib), Christian Social Party (0.4, Rel), Others (2.6, Oth)" if countryelection == 354
replace string_SCparties = "NA" if countryelection == 354
replace string_ASparties = "Green Alternative (1.3, Green), Party of Labour (0.8, Com), POCH (0.2, Com), Autonomous Socialist (0.6, Com), Ring of Independents (2.8, OR), Federal Democratic Union (1, RR), National Action (3.4, RR), Freedom Party (5.1, RR), Ticino League (1.4, RR)" if countryelection == 354

replace voteper_PSparties = 71.3 if countryelection == 354
replace voteper_CPparties = 12.1 if countryelection == 354
replace voteper_SCparties =  0   if countryelection == 354
replace voteper_ASparties = 16.6 if countryelection == 354

replace voteper_EL_ASP = 1.6 if countryelection == 354
replace voteper_RL_ASP = .      if countryelection == 354
replace voteper_ER_ASP = .        if countryelection == 354
replace voteper_RR_ASP = 10.9      if countryelection == 354
replace voteper_GREEN_ASP = 1.3    if countryelection == 354
replace voteper_PIRATE_ASP = .     if countryelection == 354
replace voteper_MISC_POP_ASP = .  if countryelection == 354
replace voteper_SEC_NAT_ASP = .   if countryelection == 354
replace voteper_REL_ASP = .      if countryelection == 354
replace voteper_OTHERR_ASP = 2.8   if countryelection == 354
replace voteper_OTHERL_ASP = .    if countryelection == 354

*1995*
replace string_PSparties = "SDP (21.8), FDP (20.2), CVP (16.8), SVP (14.9), EVP (1.8)" if countryelection == 355
replace string_CPparties = "Green (5, Green), Liberal Democratic (2.7, Lib), Christian Social Party (0.3, Rel), Others (2.4, Oth)" if countryelection == 355
replace string_SCparties = "NA" if countryelection == 355
replace string_ASparties = "Green Alternative (1.5, Green), Party of Labour (1.2, Com), Solidarites (0.3, Com), Ring of Independents (1.8, OR), Federal Democratic Union (1.3, RR), National Action (3.1, RR), Freedom Party (4, RR), Ticino League (0.9, RR)" if countryelection == 355

replace voteper_PSparties = 75.5 if countryelection == 355
replace voteper_CPparties = 10.4 if countryelection == 355
replace voteper_SCparties =  0   if countryelection == 355
replace voteper_ASparties = 14.1 if countryelection == 355

replace voteper_EL_ASP = 1.5 if countryelection == 355
replace voteper_RL_ASP = .      if countryelection == 355
replace voteper_ER_ASP = .        if countryelection == 355
replace voteper_RR_ASP = 9.3      if countryelection == 355
replace voteper_GREEN_ASP = 1.5    if countryelection == 355
replace voteper_PIRATE_ASP = .     if countryelection == 355
replace voteper_MISC_POP_ASP = .  if countryelection == 355
replace voteper_SEC_NAT_ASP = .   if countryelection == 355
replace voteper_REL_ASP = .      if countryelection == 355
replace voteper_OTHERR_ASP = 1.8   if countryelection == 355
replace voteper_OTHERL_ASP = .    if countryelection == 355

*1999*
replace string_PSparties = "SDP (22.5), FDP (19.9), CVP (15.8), EVP (1.8)" if countryelection == 356
replace string_CPparties = "Green (5, Green), Liberal Democratic (2.2, Lib), Christian Social Party (0.4, Rel), Others (2.4, Oth)" if countryelection == 356
replace string_SCparties = "SVP (22.6)" if countryelection == 356
replace string_ASparties = "Green Alternative (0.3, Green), Party of Labour (1, Com), Solidarites (0.5, Com), Ring of Independents (0.7, OR), Federal Democratic Union (1.2, RR), National Action (1.8, RR), Freedom Party (0.9, RR), Ticino League (0.9, RR)" if countryelection == 356

replace voteper_PSparties = 60   if countryelection == 356
replace voteper_CPparties = 10   if countryelection == 356
replace voteper_SCparties = 22.6 if countryelection == 356
replace voteper_ASparties =  7.3 if countryelection == 356

replace voteper_EL_ASP = 1.5 if countryelection == 356
replace voteper_RL_ASP = .      if countryelection == 356
replace voteper_ER_ASP = .        if countryelection == 356
replace voteper_RR_ASP = 4.8      if countryelection == 356
replace voteper_GREEN_ASP = 0.3    if countryelection == 356
replace voteper_PIRATE_ASP = .     if countryelection == 356
replace voteper_MISC_POP_ASP = .  if countryelection == 356
replace voteper_SEC_NAT_ASP = .   if countryelection == 356
replace voteper_REL_ASP = .      if countryelection == 356
replace voteper_OTHERR_ASP = 0.7   if countryelection == 356
replace voteper_OTHERL_ASP = .    if countryelection == 356

*2003*
replace string_PSparties = "SDP (23.3), FDP (17.3), CVP (14.4), Liberal Democratic (2.2, Lib), EVP (2.3)" if countryelection == 357
replace string_CPparties = "Green (7.4, Green), Christian Social Party (0.4, Rel), Others (1.6, Oth)" if countryelection == 357
replace string_SCparties = "SVP (26.7)" if countryelection == 357
replace string_ASparties = "Green Alternative (0.5, Green), Party of Labour (0.7, Com), Solidarites (0.5, Com), Federal Democratic Union (1.3, RR), National Action (1, RR), Freedom Party (0.2, RR), Ticino League (0.3, RR)" if countryelection == 357

replace voteper_PSparties = 59.2 if countryelection == 357
replace voteper_CPparties =  9.5 if countryelection == 357
replace voteper_SCparties = 26.7 if countryelection == 357
replace voteper_ASparties =  4.5 if countryelection == 357

replace voteper_EL_ASP = 1.2 if countryelection == 357
replace voteper_RL_ASP = .      if countryelection == 357
replace voteper_ER_ASP = .        if countryelection == 357
replace voteper_RR_ASP = 2.8      if countryelection == 357
replace voteper_GREEN_ASP = 0.5    if countryelection == 357
replace voteper_PIRATE_ASP = .     if countryelection == 357
replace voteper_MISC_POP_ASP = .  if countryelection == 357
replace voteper_SEC_NAT_ASP = .   if countryelection == 357
replace voteper_REL_ASP = .      if countryelection == 357
replace voteper_OTHERR_ASP = .   if countryelection == 357
replace voteper_OTHERL_ASP = .    if countryelection == 357

*2007*
replace string_PSparties = "SDP (19.3), FDP (15.5), CVP (14.3), Liberal Democratic (1.8, Lib), EVP (2.4)" if countryelection == 358
replace string_CPparties = "Green (9.5, Green), Green Liberals (2.1, Green), Christian Social Party (0.4, Rel), Others (2.4, Oth)" if countryelection == 358
replace string_SCparties = "SVP (28.6)" if countryelection == 358
replace string_ASparties = "Party of Labour (0.7, Com), Solidarites (0.4, Com), Federal Democratic Union (1.3, RR), National Action (0.5, RR), Freedom Party (0.2, RR), Ticino League (0.6, RR)" if countryelection == 358

replace voteper_PSparties = 53.3 if countryelection == 358
replace voteper_CPparties = 14.4 if countryelection == 358
replace voteper_SCparties = 28.6 if countryelection == 358
replace voteper_ASparties =  3.7 if countryelection == 358

replace voteper_EL_ASP = 1.1 if countryelection == 358
replace voteper_RL_ASP = .      if countryelection == 358
replace voteper_ER_ASP = .        if countryelection == 358
replace voteper_RR_ASP = 2.6      if countryelection == 358
replace voteper_GREEN_ASP = .    if countryelection == 358
replace voteper_PIRATE_ASP = .     if countryelection == 358
replace voteper_MISC_POP_ASP = .  if countryelection == 358
replace voteper_SEC_NAT_ASP = .   if countryelection == 358
replace voteper_REL_ASP = .      if countryelection == 358
replace voteper_OTHERR_ASP = .   if countryelection == 358
replace voteper_OTHERL_ASP = .    if countryelection == 358

*2011*
replace string_PSparties = "SDP (18.7), FDP (15.1), CVP (12.3), Conservative Democrats (5.4), EVP (2)" if countryelection == 359
replace string_CPparties = "Green (8.4, Green), Green Liberals (5.4, Green), Christian Social Party (0.3, Rel), Others (2.2, Oth)" if countryelection == 359
replace string_SCparties = "SVP (26.6)" if countryelection == 359
replace string_ASparties = "Party of Labour (0.5, Com), Solidarites (0.3, Com), Federal Democratic Union (1.3, RR), Geneva Citizens (0.4, RR), Ticino League (0.8, RR), Swiss Democrats (0.2, RR)" if countryelection == 359

replace voteper_PSparties = 53.5 if countryelection == 359
replace voteper_CPparties = 16.3 if countryelection == 359
replace voteper_SCparties = 26.6 if countryelection == 359
replace voteper_ASparties =  3.5 if countryelection == 359

replace voteper_EL_ASP = 0.8 if countryelection == 359
replace voteper_RL_ASP = .      if countryelection == 359
replace voteper_ER_ASP = .        if countryelection == 359
replace voteper_RR_ASP = 2.7      if countryelection == 359
replace voteper_GREEN_ASP = .    if countryelection == 359
replace voteper_PIRATE_ASP = .     if countryelection == 359
replace voteper_MISC_POP_ASP = .  if countryelection == 359
replace voteper_SEC_NAT_ASP = .   if countryelection == 359
replace voteper_REL_ASP = .      if countryelection == 359
replace voteper_OTHERR_ASP = .   if countryelection == 359
replace voteper_OTHERL_ASP = .    if countryelection == 359

*2015*
replace string_PSparties = "SDP (18.8), FDP (16.4), CVP (11.6), Conservative Democrats (4.1), EVP (1.9)" if countryelection == 360
replace string_CPparties = "Green (7.1, Green), Green Liberals (4.6, Green), Christian Social Party (0.2, Rel), Others (1.3, Oth)" if countryelection == 360
replace string_SCparties = "SVP (29.4)" if countryelection == 360
replace string_ASparties = "Party of Labour (0.4, Com), Solidarites (0.5, Com), Federal Democratic Union (1.2, RR), Geneva Citizens (0.3, RR), Ticino League (1, RR), Swiss Democrats (0.1, RR), Alternative Left (1.2, RL) " if countryelection == 360

replace voteper_PSparties = 52.8 if countryelection == 360
replace voteper_CPparties = 13.1 if countryelection == 360
replace voteper_SCparties = 29.4  if countryelection == 360
replace voteper_ASparties =  4.7 if countryelection == 360

replace voteper_EL_ASP = 0.9 if countryelection == 360
replace voteper_RL_ASP = 1.2      if countryelection == 360
replace voteper_ER_ASP = .        if countryelection == 360
replace voteper_RR_ASP = 2.6      if countryelection == 360
replace voteper_GREEN_ASP = .    if countryelection == 360
replace voteper_PIRATE_ASP = .     if countryelection == 360
replace voteper_MISC_POP_ASP = .  if countryelection == 360
replace voteper_SEC_NAT_ASP = .   if countryelection == 360
replace voteper_REL_ASP = .      if countryelection == 360
replace voteper_OTHERR_ASP = .   if countryelection == 360
replace voteper_OTHERL_ASP = .    if countryelection == 360



**************************************************** UK *******************************************************

***** Source:  Nohlen (2010) [1950-2005]
*              BBC News Website [2010-15] 


*1950*
replace string_PSparties = "Labour (46.1), Conservative (43.4), Liberal (9.1)" if countryelection == 361
replace string_CPparties = "Ind/Oth (0.4, Oth)" if countryelection == 361
replace string_SCparties = "NA" if countryelection == 361
replace string_ASparties = "Irish Nationalist (0.4, Sec), Sinn Fein (0.1, Sec), Communist (0.3, EL), PC (0.1, Sec)" if countryelection == 361

replace voteper_PSparties = 98.6 if countryelection == 361
replace voteper_CPparties =  0.4 if countryelection == 361
replace voteper_SCparties =  0   if countryelection == 361
replace voteper_ASparties =  0.9 if countryelection == 361

replace voteper_EL_ASP = 0.3 if countryelection == 361
replace voteper_RL_ASP = .      if countryelection == 361
replace voteper_ER_ASP = .        if countryelection == 361
replace voteper_RR_ASP = .      if countryelection == 361
replace voteper_GREEN_ASP = .    if countryelection == 361
replace voteper_PIRATE_ASP = .     if countryelection == 361
replace voteper_MISC_POP_ASP = .  if countryelection == 361
replace voteper_SEC_NAT_ASP = 0.6   if countryelection == 361
replace voteper_REL_ASP = .      if countryelection == 361
replace voteper_OTHERR_ASP = .   if countryelection == 361
replace voteper_OTHERL_ASP = .    if countryelection == 361

*1951*
replace string_PSparties = "Labour (48.8), Conservative (48), Liberal (2.6)" if countryelection == 362
replace string_CPparties = "Ind/Oth (0.2, Oth)" if countryelection == 362
replace string_SCparties = "NA" if countryelection == 362
replace string_ASparties = "Irish Nationalist (0.4, Sec), Communist (0.1, Com)" if countryelection == 362

replace voteper_PSparties = 99.4 if countryelection == 362
replace voteper_CPparties =  0.2 if countryelection == 362
replace voteper_SCparties =  0   if countryelection == 362
replace voteper_ASparties =  0.5 if countryelection == 362

replace voteper_EL_ASP = 0.1 if countryelection == 362
replace voteper_RL_ASP = .      if countryelection == 362
replace voteper_ER_ASP = .        if countryelection == 362
replace voteper_RR_ASP = .      if countryelection == 362
replace voteper_GREEN_ASP = .    if countryelection == 362
replace voteper_PIRATE_ASP = .     if countryelection == 362
replace voteper_MISC_POP_ASP = .  if countryelection == 362
replace voteper_SEC_NAT_ASP = 0.4   if countryelection == 362
replace voteper_REL_ASP = .      if countryelection == 362
replace voteper_OTHERR_ASP = .   if countryelection == 362
replace voteper_OTHERL_ASP = .    if countryelection == 362

*1955*
replace string_PSparties = "Labour (46.4), Conservative (49.7), Liberal (2.7)" if countryelection == 363
replace string_CPparties = "Ind/Oth (0.2, Oth)" if countryelection == 363
replace string_SCparties = "NA" if countryelection == 363
replace string_ASparties = "Irish Nationalist (0.1, Sec), Communist (0.1, Com), PC (0.2, Sec), Sinn Fein (0.6, Sec)" if countryelection == 363

replace voteper_PSparties = 98.8 if countryelection == 363
replace voteper_CPparties =  0.2 if countryelection == 363
replace voteper_SCparties =  0   if countryelection == 363
replace voteper_ASparties =  1   if countryelection == 363

replace voteper_EL_ASP = 0.1 if countryelection == 363
replace voteper_RL_ASP = .      if countryelection == 363
replace voteper_ER_ASP = .        if countryelection == 363
replace voteper_RR_ASP = .      if countryelection == 363
replace voteper_GREEN_ASP = .    if countryelection == 363
replace voteper_PIRATE_ASP = .     if countryelection == 363
replace voteper_MISC_POP_ASP = .  if countryelection == 363
replace voteper_SEC_NAT_ASP = 0.9   if countryelection == 363
replace voteper_REL_ASP = .      if countryelection == 363
replace voteper_OTHERR_ASP = .   if countryelection == 363
replace voteper_OTHERL_ASP = .    if countryelection == 363

*1959*
replace string_PSparties = "Labour (43.8), Conservative (49.4), Liberal (5.9)" if countryelection == 364
replace string_CPparties = "Ind/Oth (0.2, Oth)" if countryelection == 364
replace string_SCparties = "NA" if countryelection == 364
replace string_ASparties = "Communist (0.1, Com), PC (0.3, Sec), SNP (0.1, Sec), Sinn Fein (0.2, Sec)" if countryelection == 364

replace voteper_PSparties = 99.1 if countryelection == 364
replace voteper_CPparties =  0.2 if countryelection == 364
replace voteper_SCparties =  0   if countryelection == 364
replace voteper_ASparties =  0.7 if countryelection == 364

replace voteper_EL_ASP = 0.1 if countryelection == 364
replace voteper_RL_ASP = .      if countryelection == 364
replace voteper_ER_ASP = .        if countryelection == 364
replace voteper_RR_ASP = .      if countryelection == 364
replace voteper_GREEN_ASP = .    if countryelection == 364
replace voteper_PIRATE_ASP = .     if countryelection == 364
replace voteper_MISC_POP_ASP = .  if countryelection == 364
replace voteper_SEC_NAT_ASP = 0.6   if countryelection == 364
replace voteper_REL_ASP = .      if countryelection == 364
replace voteper_OTHERR_ASP = .   if countryelection == 364
replace voteper_OTHERL_ASP = .    if countryelection == 364

*1964*
replace string_PSparties = "Labour (44.1), Conservative (43.4), Liberal (11.2)" if countryelection == 365
replace string_CPparties = "Ind/Oth (0.1, Oth)" if countryelection == 365
replace string_SCparties = "NA" if countryelection == 365
replace string_ASparties = "Communist (0.2, Com), PC (0.3, Sec), Irish Nationalist (0.4, Sec), SNP (0.2, Sec), Sinn Fein (0.2, Sec)" if countryelection == 365

replace voteper_PSparties = 98.7 if countryelection == 365
replace voteper_CPparties =  0.1 if countryelection == 365
replace voteper_SCparties =  0   if countryelection == 365
replace voteper_ASparties =  1.3 if countryelection == 365

replace voteper_EL_ASP = 0.2 if countryelection == 365
replace voteper_RL_ASP = .      if countryelection == 365
replace voteper_ER_ASP = .        if countryelection == 365
replace voteper_RR_ASP = .      if countryelection == 365
replace voteper_GREEN_ASP = .    if countryelection == 365
replace voteper_PIRATE_ASP = .     if countryelection == 365
replace voteper_MISC_POP_ASP = .  if countryelection == 365
replace voteper_SEC_NAT_ASP = 1.1   if countryelection == 365
replace voteper_REL_ASP = .      if countryelection == 365
replace voteper_OTHERR_ASP = .   if countryelection == 365
replace voteper_OTHERL_ASP = .    if countryelection == 365

*1966*
replace string_PSparties = "Labour (48), Conservative (41.9), Liberal (8.5)" if countryelection == 366
replace string_CPparties = "Ind/Oth (0.3, Oth)" if countryelection == 366
replace string_SCparties = "NA" if countryelection == 366
replace string_ASparties = "Communist (0.2, Com), PC (0.2, Sec), Irish Nationalist (0.4, Sec), SNP (0.5, Sec)" if countryelection == 366

replace voteper_PSparties = 98.4 if countryelection == 366
replace voteper_CPparties =  0.3 if countryelection == 366
replace voteper_SCparties =  0   if countryelection == 366
replace voteper_ASparties =  1.3 if countryelection == 366

replace voteper_EL_ASP = 0.2 if countryelection == 366
replace voteper_RL_ASP = .      if countryelection == 366
replace voteper_ER_ASP = .        if countryelection == 366
replace voteper_RR_ASP = .      if countryelection == 366
replace voteper_GREEN_ASP = .    if countryelection == 366
replace voteper_PIRATE_ASP = .     if countryelection == 366
replace voteper_MISC_POP_ASP = .  if countryelection == 366
replace voteper_SEC_NAT_ASP = 1.1   if countryelection == 366
replace voteper_REL_ASP = .      if countryelection == 366
replace voteper_OTHERR_ASP = .   if countryelection == 366
replace voteper_OTHERL_ASP = .    if countryelection == 366

*1970*
replace string_PSparties = "Labour (43.1), Conservative (46.4), Liberal (7.5)" if countryelection == 367
replace string_CPparties = "Ind/Oth (0.7, Oth)" if countryelection == 367
replace string_SCparties = "NA" if countryelection == 367
replace string_ASparties = "Communist (0.1, Com), PC (0.6, Sec), Irish Nationalist (0.6, Sec), SNP (1.1, Sec)" if countryelection == 367

replace voteper_PSparties = 97 if countryelection == 367
replace voteper_CPparties =  0.7 if countryelection == 367
replace voteper_SCparties =  0 if countryelection == 367
replace voteper_ASparties = 2.4  if countryelection == 367

replace voteper_EL_ASP = 0.1 if countryelection == 367
replace voteper_RL_ASP = .      if countryelection == 367
replace voteper_ER_ASP = .        if countryelection == 367
replace voteper_RR_ASP = .      if countryelection == 367
replace voteper_GREEN_ASP = .    if countryelection == 367
replace voteper_PIRATE_ASP = .     if countryelection == 367
replace voteper_MISC_POP_ASP = .  if countryelection == 367
replace voteper_SEC_NAT_ASP = 2.3   if countryelection == 367
replace voteper_REL_ASP = .      if countryelection == 367
replace voteper_OTHERR_ASP = .   if countryelection == 367
replace voteper_OTHERL_ASP = .    if countryelection == 367

*1974a*
replace string_PSparties = "Labour (37.2), Conservative (37.9), Liberal (19.3)" if countryelection == 368
replace string_CPparties = "Ind/Oth (1, Oth)" if countryelection == 368
replace string_SCparties = "SDLP (0.5, Sec)" if countryelection == 368
replace string_ASparties = "Communist (0.1, Com), PC (0.5, Sec), Irish Nationalist (0.1, Sec), SNP (2, Sec), Vangaurd Unionist (1.2, ER), National Front (0.2, ER)" if countryelection == 368

replace voteper_PSparties = 94.4 if countryelection == 368
replace voteper_CPparties =  1   if countryelection == 368
replace voteper_SCparties =  0.5 if countryelection == 368
replace voteper_ASparties =  4.1 if countryelection == 368

replace voteper_EL_ASP = 0.1 if countryelection == 368
replace voteper_RL_ASP = .      if countryelection == 368
replace voteper_ER_ASP = 1.4        if countryelection == 368
replace voteper_RR_ASP = .      if countryelection == 368
replace voteper_GREEN_ASP = .    if countryelection == 368
replace voteper_PIRATE_ASP = .     if countryelection == 368
replace voteper_MISC_POP_ASP = .  if countryelection == 368
replace voteper_SEC_NAT_ASP = 2.6   if countryelection == 368
replace voteper_REL_ASP = .      if countryelection == 368
replace voteper_OTHERR_ASP = .   if countryelection == 368
replace voteper_OTHERL_ASP = .    if countryelection == 368

*1974b*
replace string_PSparties = "Labour (39.3), Conservative (35.8), Liberal (18.3)" if countryelection == 369
replace string_CPparties = "Ind/Oth (0.7, Oth)" if countryelection == 369
replace string_SCparties = "SDLP (0.5, Sec)" if countryelection == 369
replace string_ASparties = "Communist (0.1, Com), PC (0.6, Sec), Irish Nationalist (0.1, Sec), SNP (2.9, Sec), Vangaurd Unionist (1.4, ER), National Front (0.4, ER)" if countryelection == 369

replace voteper_PSparties = 93.4 if countryelection == 369
replace voteper_CPparties =  0.7 if countryelection == 369
replace voteper_SCparties =  0.5 if countryelection == 369
replace voteper_ASparties =  5.5 if countryelection == 369

replace voteper_EL_ASP = 0.1 if countryelection == 369
replace voteper_RL_ASP = .      if countryelection == 369
replace voteper_ER_ASP = 1.8        if countryelection == 369
replace voteper_RR_ASP = .      if countryelection == 369
replace voteper_GREEN_ASP = .    if countryelection == 369
replace voteper_PIRATE_ASP = .     if countryelection == 369
replace voteper_MISC_POP_ASP = .  if countryelection == 369
replace voteper_SEC_NAT_ASP = 3.6   if countryelection == 369
replace voteper_REL_ASP = .      if countryelection == 369
replace voteper_OTHERR_ASP = .   if countryelection == 369
replace voteper_OTHERL_ASP = .    if countryelection == 369

*1979*
replace string_PSparties = "Labour (36.9), Conservative (43.9), Liberal (13.8), Ulster Unionist (0.8, Con)" if countryelection == 370
replace string_CPparties = "Ind/Oth (1.1, Oth)" if countryelection == 370
replace string_SCparties = "SDLP (0.4, Sec)" if countryelection == 370
replace string_ASparties = "Communist (0.1, Com), PC (0.4, Sec), SNP (1.6, Sec), DUP (0.2, OR), National Front (0.6, ER), Green (0.1, Green)" if countryelection == 370

replace voteper_PSparties = 95.4 if countryelection == 370
replace voteper_CPparties =  1.1 if countryelection == 370
replace voteper_SCparties =  0.4 if countryelection == 370
replace voteper_ASparties =  3.0 if countryelection == 370

replace voteper_EL_ASP = 0.1 if countryelection == 370
replace voteper_RL_ASP = .      if countryelection == 370
replace voteper_ER_ASP = 0.6        if countryelection == 370
replace voteper_RR_ASP = .      if countryelection == 370
replace voteper_GREEN_ASP = 0.1    if countryelection == 370
replace voteper_PIRATE_ASP = .     if countryelection == 370
replace voteper_MISC_POP_ASP = .  if countryelection == 370
replace voteper_SEC_NAT_ASP = 2   if countryelection == 370
replace voteper_REL_ASP = .      if countryelection == 370
replace voteper_OTHERR_ASP = 0.2   if countryelection == 370
replace voteper_OTHERL_ASP = .    if countryelection == 370

*1983*
replace string_PSparties = "Labour (27.6), Conservative (42.4), Liberal (13.7), SDP (11.6), Ulster Unionist (0.8, Con)" if countryelection == 371
replace string_CPparties = "Ind/Oth (0.8, Oth)" if countryelection == 371
replace string_SCparties = "SDLP (0.4, Sec)" if countryelection == 371
replace string_ASparties = "PC (0.4, Sec), SNP (1.1, Sec), DUP (0.5, OR), Sinn Fein (0.3, Sec), National Front (0.1, ER), Green (0.2, Green)" if countryelection == 371

replace voteper_PSparties = 96.1 if countryelection == 371
replace voteper_CPparties =  0.8 if countryelection == 371
replace voteper_SCparties =  0.4 if countryelection == 371
replace voteper_ASparties =  2.6 if countryelection == 371

replace voteper_EL_ASP = . if countryelection == 371
replace voteper_RL_ASP = .      if countryelection == 371
replace voteper_ER_ASP = 0.1        if countryelection == 371
replace voteper_RR_ASP = .      if countryelection == 371
replace voteper_GREEN_ASP = 0.2    if countryelection == 371
replace voteper_PIRATE_ASP = .     if countryelection == 371
replace voteper_MISC_POP_ASP = .  if countryelection == 371
replace voteper_SEC_NAT_ASP = 1.8   if countryelection == 371
replace voteper_REL_ASP = .      if countryelection == 371
replace voteper_OTHERR_ASP = 0.5   if countryelection == 371
replace voteper_OTHERL_ASP = .    if countryelection == 371

*1987*
replace string_PSparties = "Labour (30.8), Conservative (42.3), Liberal (12.8), SDP (9.7), Ulster Unionist (0.8, Con)" if countryelection == 372
replace string_CPparties = "Ind/Oth (0.4, Oth)" if countryelection == 372
replace string_SCparties = "SDLP (0.5, Sec)" if countryelection == 372
replace string_ASparties = "PC (0.4, Sec), SNP (1.3, Sec), DUP (0.3, OR), Sinn Fein (0.3, Sec), Green (0.3, Green)" if countryelection == 372

replace voteper_PSparties = 96.4 if countryelection == 372
replace voteper_CPparties =  2.0 if countryelection == 372
replace voteper_SCparties =  0.5 if countryelection == 372
replace voteper_ASparties =  2.6 if countryelection == 372

replace voteper_EL_ASP = . if countryelection == 372
replace voteper_RL_ASP = .      if countryelection == 372
replace voteper_ER_ASP = .        if countryelection == 372
replace voteper_RR_ASP = .      if countryelection == 372
replace voteper_GREEN_ASP = 0.3    if countryelection == 372
replace voteper_PIRATE_ASP = .     if countryelection == 372
replace voteper_MISC_POP_ASP = .  if countryelection == 372
replace voteper_SEC_NAT_ASP = 2   if countryelection == 372
replace voteper_REL_ASP = .      if countryelection == 372
replace voteper_OTHERR_ASP = 0.3   if countryelection == 372
replace voteper_OTHERL_ASP = .    if countryelection == 372

*1992*
replace string_PSparties = "Lib Dems (17.8), Labour (34.4), Conservative (41.9), Ulster Unionist (0.9, Con)" if countryelection == 373
replace string_CPparties = "Ind/Oth (1.9, Oth)" if countryelection == 373
replace string_SCparties = "SDLP (0.5, Sec)" if countryelection == 373
replace string_ASparties = "PC (0.5, Sec), SNP (1.3, Sec), DUP (0.3, RW), Sinn Fein (0.2, Sec), Green (0.3, Green)" if countryelection == 373

replace voteper_PSparties = 95.0 if countryelection == 373
replace voteper_CPparties =  1.9 if countryelection == 373
replace voteper_SCparties =  0.5 if countryelection == 373
replace voteper_ASparties =  2.6 if countryelection == 373

replace voteper_EL_ASP = . if countryelection == 373
replace voteper_RL_ASP = .      if countryelection == 373
replace voteper_ER_ASP = .        if countryelection == 373
replace voteper_RR_ASP = .      if countryelection == 373
replace voteper_GREEN_ASP = 0.3    if countryelection == 373
replace voteper_PIRATE_ASP = .     if countryelection == 373
replace voteper_MISC_POP_ASP = .  if countryelection == 373
replace voteper_SEC_NAT_ASP = 2   if countryelection == 373
replace voteper_REL_ASP = .      if countryelection == 373
replace voteper_OTHERR_ASP = 0.3   if countryelection == 373
replace voteper_OTHERL_ASP = .    if countryelection == 373

*1997*
replace string_PSparties = "LibDem (16.8), Labour (43.2), Conservative (30.7), Ulster Unionist (0.8, Con)" if countryelection == 374
replace string_CPparties = "Ind/Oth (1.3, Oth)" if countryelection == 374
replace string_SCparties = "SDLP (0.6, Sec)" if countryelection == 374
replace string_ASparties = "PC (0.5, Sec), SNP (2, Sec), DUP (0.3, OR), Sinn Fein (0.4, Sec), Green (0.2, Green), BNP (0.1, ER), Referendum Party (2.6, Anti-EU), UKIP (0.3, Anti-EU)" if countryelection == 374

replace voteper_PSparties = 91.5 if countryelection == 374
replace voteper_CPparties =  1.3 if countryelection == 374
replace voteper_SCparties =  0.6 if countryelection == 374
replace voteper_ASparties =  6.6 if countryelection == 374

replace voteper_EL_ASP = 0.1 if countryelection == 374
replace voteper_RL_ASP = .      if countryelection == 374
replace voteper_ER_ASP = 0.1        if countryelection == 374
replace voteper_RR_ASP = .      if countryelection == 374
replace voteper_GREEN_ASP = 0.2    if countryelection == 374
replace voteper_PIRATE_ASP = .     if countryelection == 374
replace voteper_MISC_POP_ASP = 2.9  if countryelection == 374
replace voteper_SEC_NAT_ASP = 3.0   if countryelection == 374
replace voteper_REL_ASP = .      if countryelection == 374
replace voteper_OTHERR_ASP = 0.3   if countryelection == 374
replace voteper_OTHERL_ASP = .    if countryelection == 374

*2001*
replace string_PSparties = "LibDem (18.3), Labour (40.7), Conservative (31.7), Ulster Unionist (0.8, Con)" if countryelection == 375
replace string_CPparties = "Ind/Oth (1.4, Oth)" if countryelection == 375
replace string_SCparties = "SDLP (0.6, Sec)" if countryelection == 375
replace string_ASparties = "PC (0.7, Sec), SNP (1.8, Sec), DUP (0.7, RW), Scottish Socialist (RL, 0.3), Sinn Fein (0.7, Sec), Green (0.6, Green), BNP (0.2, ER), UKIP (1.5, Anti-EU)" if countryelection == 375

replace voteper_PSparties = 91.5 if countryelection == 375
replace voteper_CPparties =  1.4 if countryelection == 375
replace voteper_SCparties =  0.6  if countryelection == 375
replace voteper_ASparties =  6.5 if countryelection == 375

replace voteper_EL_ASP = . if countryelection == 375
replace voteper_RL_ASP = 0.3      if countryelection == 375
replace voteper_ER_ASP = 0.2        if countryelection == 375
replace voteper_RR_ASP = .      if countryelection == 375
replace voteper_GREEN_ASP = 0.6    if countryelection == 375
replace voteper_PIRATE_ASP = .     if countryelection == 375
replace voteper_MISC_POP_ASP = 1.5  if countryelection == 375
replace voteper_SEC_NAT_ASP = 3.2   if countryelection == 375
replace voteper_REL_ASP = .      if countryelection == 375
replace voteper_OTHERR_ASP = 0.7   if countryelection == 375
replace voteper_OTHERL_ASP = .    if countryelection == 375

*2005*
replace string_PSparties = "LibDem (22), Labour (35.2), Conservative (32.4), Ulster Unionist (0.5, Con)" if countryelection == 376
replace string_CPparties = "Ind/Oth (1.3, Oth)" if countryelection == 376
replace string_SCparties = "SDLP (0.5, Sec)" if countryelection == 376
replace string_ASparties = "PC (0.6, Sec), SNP (1.5, Sec), DUP (0.9, RW), Scottish Socialist (RL, 0.2), Respect (0.3, RL), Sinn Fein (0.6, Sec), Green (1, Green), BNP (0.7, ER), UKIP (2.2, Anti-EU)" if countryelection == 376

replace voteper_PSparties =  90.1 if countryelection == 376
replace voteper_CPparties =   1.3 if countryelection == 376
replace voteper_SCparties =   0.5 if countryelection == 376
replace voteper_ASparties =   8   if countryelection == 376

replace voteper_EL_ASP = . if countryelection == 376
replace voteper_RL_ASP = 0.5      if countryelection == 376
replace voteper_ER_ASP = 0.7        if countryelection == 376
replace voteper_RR_ASP = .      if countryelection == 376
replace voteper_GREEN_ASP = 1    if countryelection == 376
replace voteper_PIRATE_ASP = .     if countryelection == 376
replace voteper_MISC_POP_ASP = 2.2  if countryelection == 376
replace voteper_SEC_NAT_ASP = 2.7   if countryelection == 376
replace voteper_REL_ASP = .      if countryelection == 376
replace voteper_OTHERR_ASP = 0.9   if countryelection == 376
replace voteper_OTHERL_ASP = .    if countryelection == 376

*2010*
replace string_PSparties = "LibDem (23), Labour (29), Conservative (36.1), Ulster Unionist (0.3, Con)" if countryelection == 377
replace string_CPparties = "Ind/Oth (1.6, Oth)" if countryelection == 377
replace string_SCparties = "SDLP (0.4, Sec)" if countryelection == 377
replace string_ASparties = "PC (0.6, Sec), SNP (1.7, Sec), DUP (0.6, RW), Respect (0.1, RL), Sinn Fein (0.6, Sec), Green (1, Green), BNP (1.9, ER), UKIP (3.1, Anti-EU)" if countryelection == 377

replace voteper_PSparties = 88.4 if countryelection == 377
replace voteper_CPparties =  1.6 if countryelection == 377
replace voteper_SCparties =  0.4  if countryelection == 377
replace voteper_ASparties =  9.6 if countryelection == 377

replace voteper_EL_ASP = . if countryelection == 377
replace voteper_RL_ASP = 0.1      if countryelection == 377
replace voteper_ER_ASP = 1.9        if countryelection == 377
replace voteper_RR_ASP = .      if countryelection == 377
replace voteper_GREEN_ASP = 1    if countryelection == 377
replace voteper_PIRATE_ASP = .     if countryelection == 377
replace voteper_MISC_POP_ASP = 3.1  if countryelection == 377
replace voteper_SEC_NAT_ASP = 2.9   if countryelection == 377
replace voteper_REL_ASP = .      if countryelection == 377
replace voteper_OTHERR_ASP = 0.6   if countryelection == 377
replace voteper_OTHERL_ASP = .    if countryelection == 377

*2015*
replace string_PSparties = "Labour (30.4), Conservative (36.9), LibDem (7.9), Ulster Unionist (0.4, Con)" if countryelection == 378
replace string_CPparties = "Ind/Oth (1.1, Oth)" if countryelection == 378
replace string_SCparties = "SDLP (0.3, Sec)" if countryelection == 378
replace string_ASparties = "PC (0.6, Sec), SNP (4.7, Sec), DUP (0.6, RW), Sinn Fein (0.6, Sec), Green (3.8, Green), UKIP (12.6, RR)" if countryelection == 378

replace voteper_PSparties = 75.6 if countryelection == 378
replace voteper_CPparties =  1.1   if countryelection == 378
replace voteper_SCparties =  0.3 if countryelection == 378
replace voteper_ASparties =  22.9 if countryelection == 378

replace voteper_EL_ASP = . if countryelection == 378
replace voteper_RL_ASP = .      if countryelection == 378
replace voteper_ER_ASP = .        if countryelection == 378
replace voteper_RR_ASP = 12.6      if countryelection == 378
replace voteper_GREEN_ASP = 3.8    if countryelection == 378
replace voteper_PIRATE_ASP = .     if countryelection == 378
replace voteper_MISC_POP_ASP = .  if countryelection == 378
replace voteper_SEC_NAT_ASP = 5.9   if countryelection == 378
replace voteper_REL_ASP = .      if countryelection == 378
replace voteper_OTHERR_ASP = 0.6   if countryelection == 378
replace voteper_OTHERL_ASP = .    if countryelection == 378




**********************************************************  Belgium (Flanders)  ********************************************************************

***** Source:  Belgische Verkiezingsuitslagen - Belgian Election Results [1950 - 2003]
*               Service public fédéral Intérieur (IBZ) - Federal Public Service for the Interior Website [2007-2014]



*1950*
replace string_PSparties = "Christian Social Party (54.4), Socialist Party (31), Liberal (11.4)" if countryelection == 379
replace string_CPparties = "Other (0.1, Ind)" if countryelection == 379
replace string_SCparties = "NA" if countryelection == 379
replace string_ASparties = "Communist (3.2, EL)" if countryelection == 379

replace voteper_PSparties =  96.8 if countryelection == 379
replace voteper_CPparties =   0.1 if countryelection == 379
replace voteper_SCparties =   0   if countryelection == 379
replace voteper_ASparties =   3.2 if countryelection == 379

replace voteper_EL_ASP = 3.2      if countryelection == 379
replace voteper_RL_ASP =.        if countryelection == 379
replace voteper_ER_ASP =.        if countryelection == 379
replace voteper_RR_ASP = .       if countryelection == 379
replace voteper_GREEN_ASP =.     if countryelection == 379
replace voteper_PIRATE_ASP = .     if countryelection == 379
replace voteper_MISC_POP_ASP = .  if countryelection == 379
replace voteper_SEC_NAT_ASP = .   if countryelection == 379
replace voteper_REL_ASP =.       if countryelection == 379
replace voteper_OTHERR_ASP =.    if countryelection == 379
replace voteper_OTHERL_ASP = .    if countryelection == 379

*1954*
replace string_PSparties = "Christian Social Party (46), Socialist Party (34.2), Liberal (12.6)" if countryelection == 380
replace string_CPparties = "Other (0.7, Ind), Liberty Rally (1.2, Lib)" if countryelection == 380
replace string_SCparties = "NA" if countryelection == 380
replace string_ASparties = "Communist (2, EL), Christian Flemish Union (3.3, Sep)" if countryelection == 380

replace voteper_PSparties = 92.8 if countryelection == 380
replace voteper_CPparties =  1.9 if countryelection == 380
replace voteper_SCparties =  0   if countryelection == 380
replace voteper_ASparties =  5.3 if countryelection == 380

replace voteper_EL_ASP = 2      if countryelection == 380
replace voteper_RL_ASP =.        if countryelection == 380
replace voteper_ER_ASP =.        if countryelection == 380
replace voteper_RR_ASP = .       if countryelection == 380
replace voteper_GREEN_ASP =.     if countryelection == 380
replace voteper_PIRATE_ASP = .     if countryelection == 380
replace voteper_MISC_POP_ASP = .  if countryelection == 380
replace voteper_SEC_NAT_ASP = 3.3   if countryelection == 380
replace voteper_REL_ASP =.       if countryelection == 380
replace voteper_OTHERR_ASP =.    if countryelection == 380
replace voteper_OTHERL_ASP = .    if countryelection == 380

*1958*
replace string_PSparties = "Christian Social Party (50), Socialist Party (33.6), Liberal (12.4)" if countryelection == 381
replace string_CPparties = "Other (0.5, Ind)" if countryelection == 381
replace string_SCparties = "NA" if countryelection == 381
replace string_ASparties = "Communist (0.7, EL), People's Union (2.8, Sep)" if countryelection == 381

replace voteper_PSparties =  96   if countryelection == 381
replace voteper_CPparties =   0.5 if countryelection == 381
replace voteper_SCparties =   0   if countryelection == 381
replace voteper_ASparties =   3.5 if countryelection == 381

replace voteper_EL_ASP = 0.7      if countryelection == 381
replace voteper_RL_ASP =.        if countryelection == 381
replace voteper_ER_ASP =.        if countryelection == 381
replace voteper_RR_ASP = .       if countryelection == 381
replace voteper_GREEN_ASP =.     if countryelection == 381
replace voteper_PIRATE_ASP = .     if countryelection == 381
replace voteper_MISC_POP_ASP = .  if countryelection == 381
replace voteper_SEC_NAT_ASP = 2.8   if countryelection == 381
replace voteper_REL_ASP =.       if countryelection == 381
replace voteper_OTHERR_ASP =.    if countryelection == 381
replace voteper_OTHERL_ASP = .    if countryelection == 381

*1961*
replace string_PSparties = "Christian Social Party (46), Socialist Party (32.5), Liberal (12.6)" if countryelection == 382
replace string_CPparties = "Other (1.4, Ind), National Rally (0.9, Reg)" if countryelection == 382
replace string_SCparties = "NA" if countryelection == 382
replace string_ASparties = "Communist (1.6, EL), People's Union (5, Sep)" if countryelection == 382

replace voteper_PSparties =  91.1 if countryelection == 382
replace voteper_CPparties =   2.3 if countryelection == 382
replace voteper_SCparties =   0   if countryelection == 382
replace voteper_ASparties =   6.6 if countryelection == 382

replace voteper_EL_ASP = 1.6      if countryelection == 382
replace voteper_RL_ASP =.        if countryelection == 382
replace voteper_ER_ASP =.        if countryelection == 382
replace voteper_RR_ASP = .       if countryelection == 382
replace voteper_GREEN_ASP =.     if countryelection == 382
replace voteper_PIRATE_ASP = .     if countryelection == 382
replace voteper_MISC_POP_ASP = .  if countryelection == 382
replace voteper_SEC_NAT_ASP = 5   if countryelection == 382
replace voteper_REL_ASP =.       if countryelection == 382
replace voteper_OTHERR_ASP =.    if countryelection == 382
replace voteper_OTHERL_ASP = .    if countryelection == 382

*1965*
replace string_PSparties = "Christian Social Party (38.7), Socialist Party (25.2), Liberal (20.2)" if countryelection == 383
replace string_CPparties = "Other (2.1, Ind), FDF (1.9, Reg)" if countryelection == 383
replace string_SCparties = "NA" if countryelection == 383
replace string_ASparties = "Communist (2.2, EL), People's Union (9.6, Sep), Walloon Front (0.2, Sec)" if countryelection == 383

replace voteper_PSparties = 84.1 if countryelection == 383
replace voteper_CPparties =  4.0 if countryelection == 383
replace voteper_SCparties =  0   if countryelection == 383
replace voteper_ASparties = 12.0 if countryelection == 383

replace voteper_EL_ASP = 2.2      if countryelection == 383
replace voteper_RL_ASP =.        if countryelection == 383
replace voteper_ER_ASP =.        if countryelection == 383
replace voteper_RR_ASP = .       if countryelection == 383
replace voteper_GREEN_ASP =.     if countryelection == 383
replace voteper_PIRATE_ASP = .     if countryelection == 383
replace voteper_MISC_POP_ASP = .  if countryelection == 383
replace voteper_SEC_NAT_ASP = 9.8  if countryelection == 383
replace voteper_REL_ASP =.       if countryelection == 383
replace voteper_OTHERR_ASP =.    if countryelection == 383
replace voteper_OTHERL_ASP = .    if countryelection == 383

*1968*
replace string_PSparties = "Christian Social Party (36.1), Socialist Party + RL (25), Liberal (18.6)" if countryelection == 384
replace string_CPparties = "Other (0.3, Ind), FDF (4.2, Reg)" if countryelection == 384
replace string_SCparties = "NA" if countryelection == 384
replace string_ASparties = "Communist (1.8, EL), People's Union (14, Sep)" if countryelection == 384

replace voteper_PSparties = 79.7 if countryelection == 384
replace voteper_CPparties =  4.5 if countryelection == 384
replace voteper_SCparties =  0   if countryelection == 384
replace voteper_ASparties = 15.8 if countryelection == 384

replace voteper_EL_ASP = 1.8      if countryelection == 384
replace voteper_RL_ASP =.        if countryelection == 384
replace voteper_ER_ASP =.        if countryelection == 384
replace voteper_RR_ASP = .       if countryelection == 384
replace voteper_GREEN_ASP =.     if countryelection == 384
replace voteper_PIRATE_ASP = .     if countryelection == 384
replace voteper_MISC_POP_ASP = .  if countryelection == 384
replace voteper_SEC_NAT_ASP = 14   if countryelection == 384
replace voteper_REL_ASP =.       if countryelection == 384
replace voteper_OTHERR_ASP =.    if countryelection == 384
replace voteper_OTHERL_ASP = .    if countryelection == 384

*1971*
replace string_PSparties = "Christian Social Party (34), Socialist Party (21.2), Liberal (15.9), Red Lions (2.8)" if countryelection == 385
replace string_CPparties = "Other (0.8, Ind), FDF (7.7, Reg)" if countryelection == 385
replace string_SCparties = "NA" if countryelection == 385
replace string_ASparties = "Communist (1.8, EL), People's Union (15.8, Sep)" if countryelection == 385

replace voteper_PSparties = 73.9 if countryelection == 385
replace voteper_CPparties =  8.5 if countryelection == 385
replace voteper_SCparties =  0   if countryelection == 385
replace voteper_ASparties = 17.6 if countryelection == 385

replace voteper_EL_ASP = 1.8      if countryelection == 385
replace voteper_RL_ASP =.        if countryelection == 385
replace voteper_ER_ASP =.        if countryelection == 385
replace voteper_RR_ASP = .       if countryelection == 385
replace voteper_GREEN_ASP =.     if countryelection == 385
replace voteper_PIRATE_ASP = .     if countryelection == 385
replace voteper_MISC_POP_ASP = .  if countryelection == 385
replace voteper_SEC_NAT_ASP = 15.8   if countryelection == 385
replace voteper_REL_ASP =.       if countryelection == 385
replace voteper_OTHERR_ASP =.    if countryelection == 385
replace voteper_OTHERL_ASP = .    if countryelection == 385


*1974*
replace string_PSparties = "Christian Social Party (36.5), Socialist Party (19.9), Liberal (14.7), Red Lions (2.3)" if countryelection == 386
replace string_CPparties = "Other (1.1, Ind), FDF (8.1, Reg)" if countryelection == 386
replace string_SCparties = "NA" if countryelection == 386
replace string_ASparties = "Communist (2.1, EL), AMADA (0.5, EL), VFP-PFU (0.4, EL), People's Union (14.4, Sep)" if countryelection == 386

replace voteper_PSparties = 74.3 if countryelection == 386
replace voteper_CPparties =  8   if countryelection == 386
replace voteper_SCparties =  0   if countryelection == 386
replace voteper_ASparties = 17.7 if countryelection == 386

replace voteper_EL_ASP = 2.4     if countryelection == 386
replace voteper_RL_ASP =.        if countryelection == 386
replace voteper_ER_ASP =.        if countryelection == 386
replace voteper_RR_ASP = .       if countryelection == 386
replace voteper_GREEN_ASP =.     if countryelection == 386
replace voteper_PIRATE_ASP = .     if countryelection == 386
replace voteper_MISC_POP_ASP = .  if countryelection == 386
replace voteper_SEC_NAT_ASP = 15.3   if countryelection == 386
replace voteper_REL_ASP =.       if countryelection == 386
replace voteper_OTHERR_ASP =.    if countryelection == 386
replace voteper_OTHERL_ASP = .    if countryelection == 386

*1977*
replace string_PSparties = "Christian Social Party (40.2), Socialist Party (22), Liberal (14.3)" if countryelection == 387
replace string_CPparties = "Other (0.2, Ind), FDF (6.6, Reg)" if countryelection == 387
replace string_SCparties = "NA" if countryelection == 387
replace string_ASparties = "Communist (1.6, EL), AMADA (0.6, EL), People's Union (14.1, Sep), Greens (0.4)" if countryelection == 387 //* After this period PU entered gov and accepted Egmont Pact on Federalism instead of Separatism, leading to VB break-away.

replace voteper_PSparties = 76.5 if countryelection == 387
replace voteper_CPparties =  6.8 if countryelection == 387
replace voteper_SCparties =  0   if countryelection == 387
replace voteper_ASparties = 16.7 if countryelection == 387

replace voteper_EL_ASP = 2.2      if countryelection == 387
replace voteper_RL_ASP =.        if countryelection == 387
replace voteper_ER_ASP =.        if countryelection == 387
replace voteper_RR_ASP = .       if countryelection == 387
replace voteper_GREEN_ASP = 0.4   if countryelection == 387
replace voteper_PIRATE_ASP = .     if countryelection == 387
replace voteper_MISC_POP_ASP = .  if countryelection == 387
replace voteper_SEC_NAT_ASP = 14.1   if countryelection == 387
replace voteper_REL_ASP =.       if countryelection == 387
replace voteper_OTHERR_ASP =.    if countryelection == 387
replace voteper_OTHERL_ASP = .    if countryelection == 387

*1978*
replace string_PSparties = "Christian Social Party (39.8), FDF (6.5), Socialist Party (20.5), Liberal (15.1), Walloon Rally (0.6, Sec), People's Union (9.8, Sep)" if countryelection == 388
replace string_CPparties = "Other (1.3, Ind)" if countryelection == 388
replace string_SCparties = "NA" if countryelection == 388
replace string_ASparties = "Communist (2.1, EL), AMADA (1, EL), Greens (0.6), Union for Respect of Labour (0.8, EL), Vlams Blok (1.9, RR)" if countryelection == 388

replace voteper_PSparties = 92.3 if countryelection == 388
replace voteper_CPparties =  1.2 if countryelection == 388
replace voteper_SCparties =  0   if countryelection == 388
replace voteper_ASparties =  6.4 if countryelection == 388

replace voteper_EL_ASP = 3.9       if countryelection == 388
replace voteper_RL_ASP =.        if countryelection == 388
replace voteper_ER_ASP =.        if countryelection == 388
replace voteper_RR_ASP = 1.9       if countryelection == 388
replace voteper_GREEN_ASP = 0.6     if countryelection == 388
replace voteper_PIRATE_ASP = .     if countryelection == 388
replace voteper_MISC_POP_ASP = .  if countryelection == 388
replace voteper_SEC_NAT_ASP = .   if countryelection == 388
replace voteper_REL_ASP =.       if countryelection == 388
replace voteper_OTHERR_ASP =.    if countryelection == 388
replace voteper_OTHERL_ASP = .    if countryelection == 388

*1981*
replace string_PSparties = "Christian Social Party (29.2), FDF (3.9), Socialist Party (20.4), Liberal (21.8), People's Union (13.7, Sep)" if countryelection == 389
replace string_CPparties = "Other (0.6, Ind)" if countryelection == 389
replace string_SCparties = "NA" if countryelection == 389
replace string_ASparties = "Communist (1.5, EL), Worker's Party (1, EL), Union for Respect of Labour (2, EL), Vlams Blok (1.6, RR), AGALEV/GROEN (4.3, Green)" if countryelection == 389

replace voteper_PSparties = 89.0 if countryelection == 389
replace voteper_CPparties =  0.6 if countryelection == 389
replace voteper_SCparties =  0   if countryelection == 389
replace voteper_ASparties = 10.4 if countryelection == 389

replace voteper_EL_ASP = 4.5      if countryelection == 389
replace voteper_RL_ASP =.        if countryelection == 389
replace voteper_ER_ASP =.        if countryelection == 389
replace voteper_RR_ASP = 1.6       if countryelection == 389
replace voteper_GREEN_ASP = 4.3     if countryelection == 389
replace voteper_PIRATE_ASP = .     if countryelection == 389
replace voteper_MISC_POP_ASP = .  if countryelection == 389
replace voteper_SEC_NAT_ASP = .   if countryelection == 389
replace voteper_REL_ASP =.       if countryelection == 389
replace voteper_OTHERR_ASP =.    if countryelection == 389
replace voteper_OTHERL_ASP = .    if countryelection == 389

*1985*
replace string_PSparties = "Christian Social Party (32.8), FDF (1.7), Socialist Party (24.5), Liberal (17.6), People's Union (11.3, Sep)" if countryelection == 390
replace string_CPparties = "Other (0.7, Ind)" if countryelection == 390
replace string_SCparties = "NA" if countryelection == 390
replace string_ASparties = "Communist (0.7, Com), Worker's Party (0.9, Com), Union for Respect of Labour (1.1, Com), Vlams Blok (2, RR), AGALEV/GROEN (6.7, Green)" if countryelection == 390

replace voteper_PSparties =  87.9 if countryelection == 390
replace voteper_CPparties =   0.7 if countryelection == 390
replace voteper_SCparties =   0   if countryelection == 390
replace voteper_ASparties =  11.4 if countryelection == 390

replace voteper_EL_ASP = 2.7      if countryelection == 390
replace voteper_RL_ASP =.        if countryelection == 390
replace voteper_ER_ASP =.        if countryelection == 390
replace voteper_RR_ASP = 2       if countryelection == 390
replace voteper_GREEN_ASP = 6.7     if countryelection == 390
replace voteper_PIRATE_ASP = .     if countryelection == 390
replace voteper_MISC_POP_ASP = .  if countryelection == 390
replace voteper_SEC_NAT_ASP = .   if countryelection == 390
replace voteper_REL_ASP =.       if countryelection == 390
replace voteper_OTHERR_ASP =.    if countryelection == 390
replace voteper_OTHERL_ASP = .    if countryelection == 390

*1987*
replace string_PSparties = "Christian Social Party (31.8), FDF (1.7), Socialist Party (23.7), Liberal (20.1), People's Union (11, Sep)" if countryelection == 391
replace string_CPparties = "Other (0.6, Ind)" if countryelection == 391
replace string_SCparties = "NA" if countryelection == 391
replace string_ASparties = "Communist (0.6, EL), Worker's Party (0.9, EL), Vlams Blok (2.0, RR), AGALEV/GROEN (6.5, Green), RAD-UDRT (1.1, EL)" if countryelection == 391

replace voteper_PSparties = 88.3 if countryelection == 391
replace voteper_CPparties =  0.6 if countryelection == 391
replace voteper_SCparties =  0   if countryelection == 391
replace voteper_ASparties = 11.1 if countryelection == 391

replace voteper_EL_ASP = 2.6      if countryelection == 391
replace voteper_RL_ASP =.        if countryelection == 391
replace voteper_ER_ASP =.        if countryelection == 391
replace voteper_RR_ASP = 2       if countryelection == 391
replace voteper_GREEN_ASP = 6.5     if countryelection == 391
replace voteper_PIRATE_ASP = .     if countryelection == 391
replace voteper_MISC_POP_ASP = .  if countryelection == 391
replace voteper_SEC_NAT_ASP = .   if countryelection == 391
replace voteper_REL_ASP =.       if countryelection == 391
replace voteper_OTHERR_ASP =.    if countryelection == 391
replace voteper_OTHERL_ASP = .    if countryelection == 391

*1991*
replace string_PSparties = "Christian Social Party (26.9), FDF (0.1), Socialist Party (19.8), Liberal (19.1), People's Union (9.3, Sep)" if countryelection == 392
replace string_CPparties = "Other (0.7, Ind)" if countryelection == 392
replace string_SCparties = "NA" if countryelection == 392
replace string_ASparties = "Worker's Party (0.5, EL), ROSSEM/BANNAN (5.2, OR), Vlams Blok (10.4, RR), AGALEV/GROEN (8, Green)" if countryelection == 392

replace voteper_PSparties = 75.2 if countryelection == 392
replace voteper_CPparties =  0.7   if countryelection == 392
replace voteper_SCparties =  0   if countryelection == 392
replace voteper_ASparties = 24.1 if countryelection == 392

replace voteper_EL_ASP = 0.5      if countryelection == 392
replace voteper_RL_ASP =.        if countryelection == 392
replace voteper_ER_ASP =.        if countryelection == 392
replace voteper_RR_ASP = 10.4       if countryelection == 392
replace voteper_GREEN_ASP = 8     if countryelection == 392
replace voteper_PIRATE_ASP = .     if countryelection == 392
replace voteper_MISC_POP_ASP = .  if countryelection == 392
replace voteper_SEC_NAT_ASP = .   if countryelection == 392
replace voteper_REL_ASP =.       if countryelection == 392
replace voteper_OTHERR_ASP = 5.2    if countryelection == 392
replace voteper_OTHERL_ASP = .    if countryelection == 392

*1995*
replace string_PSparties = "Christian Social Party (27.5), Socialist Party (20.6), Liberal (20.8), People's Union (7.3, Sep)" if countryelection == 393
replace string_CPparties = "Other (2.7, Ind), AGALEV/GROEN (7.2, Green)" if countryelection == 393
replace string_SCparties = "NA" if countryelection == 393
replace string_ASparties = "Worker's Party (0.6, EL), ROSSEM/BANNAN (1, OR), Vlams Blok (12.3, RR)" if countryelection == 393

replace voteper_PSparties = 76.2 if countryelection == 393
replace voteper_CPparties =  9.9 if countryelection == 393
replace voteper_SCparties =  0   if countryelection == 393
replace voteper_ASparties = 13.9 if countryelection == 393

replace voteper_EL_ASP = 0.6      if countryelection == 393
replace voteper_RL_ASP =.        if countryelection == 393
replace voteper_ER_ASP =.        if countryelection == 393
replace voteper_RR_ASP = 12.3       if countryelection == 393
replace voteper_GREEN_ASP =.     if countryelection == 393
replace voteper_PIRATE_ASP = .     if countryelection == 393
replace voteper_MISC_POP_ASP = .  if countryelection == 393
replace voteper_SEC_NAT_ASP = .   if countryelection == 393
replace voteper_REL_ASP =.       if countryelection == 393
replace voteper_OTHERR_ASP = 1    if countryelection == 393
replace voteper_OTHERL_ASP = .    if countryelection == 393

*1999*
replace string_PSparties = "Christian Social Party (22.6), Socialist Party (15.6), Liberal (22.8), People's Union (8.8, Sep)" if countryelection == 394
replace string_CPparties = "Other (0.8, Ind), AGALEV/GROEN (11.4, Green), Vivant (2, Lib)" if countryelection == 394
replace string_SCparties = "NA" if countryelection == 394
replace string_ASparties = "Worker's Party (0.6, EL), Vlams Blok (15.4, RR)" if countryelection == 394

replace voteper_PSparties = 69.8 if countryelection == 394
replace voteper_CPparties = 14.2 if countryelection == 394
replace voteper_SCparties =  0   if countryelection == 394
replace voteper_ASparties = 16.0 if countryelection == 394

replace voteper_EL_ASP = 0.6      if countryelection == 394
replace voteper_RL_ASP =.        if countryelection == 394
replace voteper_ER_ASP =.        if countryelection == 394
replace voteper_RR_ASP = 15.4       if countryelection == 394
replace voteper_GREEN_ASP =.     if countryelection == 394
replace voteper_PIRATE_ASP = .     if countryelection == 394
replace voteper_MISC_POP_ASP = .  if countryelection == 394
replace voteper_SEC_NAT_ASP = .   if countryelection == 394
replace voteper_REL_ASP =.       if countryelection == 394
replace voteper_OTHERR_ASP =.    if countryelection == 394
replace voteper_OTHERL_ASP = .    if countryelection == 394

*2003*
replace string_PSparties = "Christian Social Party (21.6), Socialist Party (24.3), Liberal (24.3), AGALEV/GROEN (3.9, Green)" if countryelection == 395
replace string_CPparties = "Other (0.5, Ind), Vivant (1.2, Lib), Liberal Appeal (0.7)" if countryelection == 395
replace string_SCparties = "NA" if countryelection == 395
replace string_ASparties = "Worker's Party (0.3, EL), Vlams Blok (18, RR), New Flemish Alliance (4.9, Sec), RESIST (0.3, EL)" if countryelection == 395

replace voteper_PSparties = 74.1 if countryelection == 395
replace voteper_CPparties =  2.4 if countryelection == 395
replace voteper_SCparties =  0   if countryelection == 395
replace voteper_ASparties = 23.5 if countryelection == 395

replace voteper_EL_ASP = 0.6      if countryelection == 395
replace voteper_RL_ASP =.        if countryelection == 395
replace voteper_ER_ASP =.        if countryelection == 395
replace voteper_RR_ASP = 18       if countryelection == 395
replace voteper_GREEN_ASP =.     if countryelection == 395
replace voteper_PIRATE_ASP = .     if countryelection == 395
replace voteper_MISC_POP_ASP = .  if countryelection == 395
replace voteper_SEC_NAT_ASP = 4.9   if countryelection == 395
replace voteper_REL_ASP =.       if countryelection == 395
replace voteper_OTHERR_ASP =.    if countryelection == 395
replace voteper_OTHERL_ASP = .    if countryelection == 395

*2007*
replace string_PSparties = "Christian Social Party (29.9), Socialist Party (17), Liberal (19.1), AGALEV (6.5, Green)" if countryelection == 396
replace string_CPparties = "Other (0.8, Ind)" if countryelection == 396
replace string_SCparties = "NA" if countryelection == 396
replace string_ASparties = "Worker's Party (1, EL), Vlams Blok (19.1, RR), List Dedecker (6.6, OR)" if countryelection == 396

replace voteper_PSparties = 72.5 if countryelection == 396
replace voteper_CPparties =  0.8 if countryelection == 396
replace voteper_SCparties =  0   if countryelection == 396
replace voteper_ASparties = 26.7 if countryelection == 396

replace voteper_EL_ASP = 1       if countryelection == 396
replace voteper_RL_ASP =.        if countryelection == 396
replace voteper_ER_ASP =.        if countryelection == 396
replace voteper_RR_ASP = 19.1       if countryelection == 396
replace voteper_GREEN_ASP =.     if countryelection == 396
replace voteper_PIRATE_ASP = .     if countryelection == 396
replace voteper_MISC_POP_ASP = .  if countryelection == 396
replace voteper_SEC_NAT_ASP = .   if countryelection == 396
replace voteper_REL_ASP =.       if countryelection == 396
replace voteper_OTHERR_ASP = 6.6    if countryelection == 396
replace voteper_OTHERL_ASP = .    if countryelection == 396

*2010*
replace string_PSparties = "Christian Social Party (17.6), Socialist Party (15.3), Liberal (13.9), GROEN (7.1, Green)" if countryelection == 397
replace string_CPparties = "Other (0.5, Ind)" if countryelection == 397
replace string_SCparties = "New Flemish Alliance (27.9, Sec)" if countryelection == 397
replace string_ASparties = "Worker's Party (1.4, RL), Vlams Blok (12.5 RR), List Dedecker (3.8, Libertarian)" if countryelection == 397

replace voteper_PSparties = 53.9 if countryelection == 397
replace voteper_CPparties =  0.5   if countryelection == 397
replace voteper_SCparties = 27.9 if countryelection == 397
replace voteper_ASparties = 17.7 if countryelection == 397

replace voteper_EL_ASP = .      if countryelection == 397
replace voteper_RL_ASP = 1.4        if countryelection == 397
replace voteper_ER_ASP =.        if countryelection == 397
replace voteper_RR_ASP = 12.5       if countryelection == 397
replace voteper_GREEN_ASP =.     if countryelection == 397
replace voteper_PIRATE_ASP = .     if countryelection == 397
replace voteper_MISC_POP_ASP = .  if countryelection == 397
replace voteper_SEC_NAT_ASP = .   if countryelection == 397
replace voteper_REL_ASP =.       if countryelection == 397
replace voteper_OTHERR_ASP = 3.8    if countryelection == 397
replace voteper_OTHERL_ASP = .    if countryelection == 397

*2014*
replace string_PSparties = "Christian Social Party (18.6), Socialist Party (14), Liberal (15.5), FDF (0.4, Lib), GROEN (8.6, Green)" if countryelection == 398
replace string_CPparties = "Other (0.3, Ind)" if countryelection == 398
replace string_SCparties = "New Flemish Alliance (32.4, Sec)" if countryelection == 398
replace string_ASparties = "Worker's Party (2.8, RL), Rossem (0.3, OR), Pirate Party (0.6, Pirate), Vlams Blok (5.8 RR), List Dedecker (0.7)" if countryelection == 398

replace voteper_PSparties = 57.1 if countryelection == 398
replace voteper_CPparties =  0.3 if countryelection == 398
replace voteper_SCparties = 32.4 if countryelection == 398
replace voteper_ASparties = 10.2 if countryelection == 398

replace voteper_EL_ASP = .      if countryelection == 398
replace voteper_RL_ASP = 2.8        if countryelection == 398
replace voteper_ER_ASP =.        if countryelection == 398
replace voteper_RR_ASP = 5.8       if countryelection == 398
replace voteper_GREEN_ASP =.     if countryelection == 398
replace voteper_PIRATE_ASP = 0.6     if countryelection == 398
replace voteper_MISC_POP_ASP = .  if countryelection == 398
replace voteper_SEC_NAT_ASP = .   if countryelection == 398
replace voteper_REL_ASP = .       if countryelection == 398
replace voteper_OTHERR_ASP = 1    if countryelection == 398
replace voteper_OTHERL_ASP = .    if countryelection == 398



******************************************************* Belgium (Wallonia) ****************************************************************

***** Source:  Belgische Verkiezingsuitslagen - Belgian Election Results [1950 - 2003]
*               Service public fédéral Intérieur (IBZ) - Federal Public Service for the Interior Website [2007-2014]

*1950*
replace string_PSparties = "Christian Social Party (34.1), Socialist Party (44.4), Liberal (13.7)" if countryelection == 399
replace string_CPparties = "NA" if countryelection == 399
replace string_SCparties = "NA" if countryelection == 399
replace string_ASparties = "Communist (7.9, EL)" if countryelection == 399

replace voteper_PSparties =  92.2 if countryelection == 399
replace voteper_CPparties =   0 if countryelection == 399
replace voteper_SCparties =   0   if countryelection == 399
replace voteper_ASparties =   7.9 if countryelection == 399

replace voteper_EL_ASP = 7.9      if countryelection == 399
replace voteper_RL_ASP =.        if countryelection == 399
replace voteper_ER_ASP =.        if countryelection == 399
replace voteper_RR_ASP = .       if countryelection == 399
replace voteper_GREEN_ASP =.     if countryelection == 399
replace voteper_PIRATE_ASP = .     if countryelection == 399
replace voteper_MISC_POP_ASP = .  if countryelection == 399
replace voteper_SEC_NAT_ASP = .   if countryelection == 399
replace voteper_REL_ASP =.       if countryelection == 399
replace voteper_OTHERR_ASP =.    if countryelection == 399
replace voteper_OTHERL_ASP = .    if countryelection == 399

*1954*
replace string_PSparties = "Christian Social Party (30.9), Socialist Party (50.4), Liberal (11.3)" if countryelection == 400
replace string_CPparties = "Other (0.6, Ind)" if countryelection == 400
replace string_SCparties = "NA" if countryelection == 400
replace string_ASparties = "Communist (6.9, EL)" if countryelection == 400

replace voteper_PSparties = 92.5 if countryelection == 400
replace voteper_CPparties =  0.6 if countryelection == 400
replace voteper_SCparties =  0   if countryelection == 400
replace voteper_ASparties =  6.9 if countryelection == 400

replace voteper_EL_ASP = 6.9      if countryelection == 400
replace voteper_RL_ASP =.        if countryelection == 400
replace voteper_ER_ASP =.        if countryelection == 400
replace voteper_RR_ASP = .       if countryelection == 400
replace voteper_GREEN_ASP =.     if countryelection == 400
replace voteper_PIRATE_ASP = .     if countryelection == 400
replace voteper_MISC_POP_ASP = .  if countryelection == 400
replace voteper_SEC_NAT_ASP = .  if countryelection == 400
replace voteper_REL_ASP =.       if countryelection == 400
replace voteper_OTHERR_ASP =.    if countryelection == 400
replace voteper_OTHERL_ASP = .    if countryelection == 400

*1958*
replace string_PSparties = "Christian Social Party (35), Socialist Party (45.4), Liberal (13.6)" if countryelection == 401
replace string_CPparties = "Other (1.4, Ind)" if countryelection == 401
replace string_SCparties = "NA" if countryelection == 401
replace string_ASparties = "Communist (4.6, EL)" if countryelection == 401

replace voteper_PSparties =  94.0 if countryelection == 401
replace voteper_CPparties =   1.4 if countryelection == 401
replace voteper_SCparties =   0   if countryelection == 401
replace voteper_ASparties =   4.6 if countryelection == 401

replace voteper_EL_ASP = 4.6      if countryelection == 401
replace voteper_RL_ASP =.        if countryelection == 401
replace voteper_ER_ASP =.        if countryelection == 401
replace voteper_RR_ASP = .       if countryelection == 401
replace voteper_GREEN_ASP =.     if countryelection == 401
replace voteper_PIRATE_ASP = .     if countryelection == 401
replace voteper_MISC_POP_ASP = .  if countryelection == 401
replace voteper_SEC_NAT_ASP = .   if countryelection == 401
replace voteper_REL_ASP =.       if countryelection == 401
replace voteper_OTHERR_ASP =.    if countryelection == 401
replace voteper_OTHERL_ASP = .    if countryelection == 401

*1961*
replace string_PSparties = "Christian Social Party (31.2), Socialist Party (46.3), Liberal (11.7)" if countryelection == 402
replace string_CPparties = "Other (4.4, Ind)" if countryelection == 402
replace string_SCparties = "NA" if countryelection == 402
replace string_ASparties = "Communist (6.4, EL)" if countryelection == 402

replace voteper_PSparties =  89.2 if countryelection == 402
replace voteper_CPparties =   4.4 if countryelection == 402
replace voteper_SCparties =   0   if countryelection == 402
replace voteper_ASparties =   6.4 if countryelection == 402

replace voteper_EL_ASP = 6.4      if countryelection == 402
replace voteper_RL_ASP =.        if countryelection == 402
replace voteper_ER_ASP =.        if countryelection == 402
replace voteper_RR_ASP = .       if countryelection == 402
replace voteper_GREEN_ASP =.     if countryelection == 402
replace voteper_PIRATE_ASP = .     if countryelection == 402
replace voteper_MISC_POP_ASP = .  if countryelection == 402
replace voteper_SEC_NAT_ASP = .   if countryelection == 402
replace voteper_REL_ASP =.       if countryelection == 402
replace voteper_OTHERR_ASP =.    if countryelection == 402
replace voteper_OTHERL_ASP = .    if countryelection == 402

*1965*
replace string_PSparties = "Christian Social Party (24.8), Socialist Party (35.5), Liberal (24.9)" if countryelection == 403
replace string_CPparties = "Other (1.3, Ind)" if countryelection == 403
replace string_SCparties = "NA" if countryelection == 403
replace string_ASparties = "Communist (10.5, EL), Walloon Front (3.1, Sec)" if countryelection == 403

replace voteper_PSparties = 85.2 if countryelection == 403
replace voteper_CPparties =  1.3 if countryelection == 403
replace voteper_SCparties =  0   if countryelection == 403
replace voteper_ASparties = 13.6 if countryelection == 403

replace voteper_EL_ASP = 10.5     if countryelection == 403
replace voteper_RL_ASP =.        if countryelection == 403
replace voteper_ER_ASP =.        if countryelection == 403
replace voteper_RR_ASP = .       if countryelection == 403
replace voteper_GREEN_ASP =.     if countryelection == 403
replace voteper_PIRATE_ASP = .     if countryelection == 403
replace voteper_MISC_POP_ASP = .  if countryelection == 403
replace voteper_SEC_NAT_ASP = 3.1  if countryelection == 403
replace voteper_REL_ASP =.       if countryelection == 403
replace voteper_OTHERR_ASP =.    if countryelection == 403
replace voteper_OTHERL_ASP = .    if countryelection == 403

*1968*
replace string_PSparties = "Christian Social Party (21.5), Socialist Party (35), Liberal (26.2)" if countryelection == 404
replace string_CPparties = "Other (0.5, Ind)" if countryelection == 404
replace string_SCparties = "NA" if countryelection == 404
replace string_ASparties = "Communist (7.1, EL), Walloon Front (9.8, Sec)" if countryelection == 404

replace voteper_PSparties = 82.7 if countryelection == 404
replace voteper_CPparties =  0.5 if countryelection == 404
replace voteper_SCparties =  0   if countryelection == 404
replace voteper_ASparties =  16.9 if countryelection == 404

replace voteper_EL_ASP = 7.1      if countryelection == 404
replace voteper_RL_ASP =.        if countryelection == 404
replace voteper_ER_ASP =.        if countryelection == 404
replace voteper_RR_ASP = .       if countryelection == 404
replace voteper_GREEN_ASP =.     if countryelection == 404
replace voteper_PIRATE_ASP = .     if countryelection == 404
replace voteper_MISC_POP_ASP = .  if countryelection == 404
replace voteper_SEC_NAT_ASP = 9.8   if countryelection == 404
replace voteper_REL_ASP =.       if countryelection == 404
replace voteper_OTHERR_ASP =.    if countryelection == 404
replace voteper_OTHERL_ASP = .    if countryelection == 404

*1971*
replace string_PSparties = "Christian Social Party (20.9), Socialist Party (35.1), Liberal (17.6)" if countryelection == 405
replace string_CPparties = "Other (0.6, Ind)" if countryelection == 405
replace string_SCparties = "NA" if countryelection == 405
replace string_ASparties = "Communist (6, EL), Walloon Rally (19.6, Sec), Trotskyists (0.2, Com)" if countryelection == 405

replace voteper_PSparties = 73.6 if countryelection == 405
replace voteper_CPparties =  0.6 if countryelection == 405
replace voteper_SCparties =  0   if countryelection == 405
replace voteper_ASparties = 25.8   if countryelection == 405

replace voteper_EL_ASP = 6.2      if countryelection == 405
replace voteper_RL_ASP =.        if countryelection == 405
replace voteper_ER_ASP =.        if countryelection == 405
replace voteper_RR_ASP = .       if countryelection == 405
replace voteper_GREEN_ASP =.     if countryelection == 405
replace voteper_PIRATE_ASP = .     if countryelection == 405
replace voteper_MISC_POP_ASP = .  if countryelection == 405
replace voteper_SEC_NAT_ASP = 19.6   if countryelection == 405
replace voteper_REL_ASP =.       if countryelection == 405
replace voteper_OTHERR_ASP =.    if countryelection == 405
replace voteper_OTHERL_ASP = .    if countryelection == 405

*1974*
replace string_PSparties = "Christian Social Party (22.8), Socialist Party (37.4), Liberal (19.7)" if countryelection == 406
replace string_CPparties = "Other (1.3, Ind), UDP (4.1, Oth), German-Speakers Party (0.6)" if countryelection == 406
replace string_SCparties = "NA" if countryelection == 406
replace string_ASparties = "Communist (1.9, EL), VFP-PFU (0.3, EL), Walloon Front (11.4, Sec)" if countryelection == 406

replace voteper_PSparties = 80.4 if countryelection == 406
replace voteper_CPparties =  6.0   if countryelection == 406
replace voteper_SCparties =  0   if countryelection == 406
replace voteper_ASparties = 13.6 if countryelection == 406

replace voteper_EL_ASP = 1.9     if countryelection == 406
replace voteper_RL_ASP =.        if countryelection == 406
replace voteper_ER_ASP =.        if countryelection == 406
replace voteper_RR_ASP = .       if countryelection == 406
replace voteper_GREEN_ASP =.     if countryelection == 406
replace voteper_PIRATE_ASP = .     if countryelection == 406
replace voteper_MISC_POP_ASP = .  if countryelection == 406
replace voteper_SEC_NAT_ASP = 11.4   if countryelection == 406
replace voteper_REL_ASP =.       if countryelection == 406
replace voteper_OTHERR_ASP =.    if countryelection == 406
replace voteper_OTHERL_ASP = 0.3    if countryelection == 406

*1977*
replace string_PSparties = "Christian Social Party (26), Socialist Party (40.2), Liberal (18.8), Walloon Front (8.4, Sec)" if countryelection == 407
replace string_CPparties = "German Speaking Party (0.5)" if countryelection == 407
replace string_SCparties = "NA" if countryelection == 407
replace string_ASparties = "Communist (5.6, EL), ECOLO (0.5, Green), AMADA (0.1, EL)" if countryelection == 407

replace voteper_PSparties = 93.4 if countryelection == 407
replace voteper_CPparties =  0.5 if countryelection == 407
replace voteper_SCparties =  0   if countryelection == 407
replace voteper_ASparties = 6.2 if countryelection == 407

replace voteper_EL_ASP = 5.7      if countryelection == 407
replace voteper_RL_ASP =.        if countryelection == 407
replace voteper_ER_ASP =.        if countryelection == 407
replace voteper_RR_ASP = .       if countryelection == 407
replace voteper_GREEN_ASP = 0.5     if countryelection == 407
replace voteper_PIRATE_ASP = .     if countryelection == 407
replace voteper_MISC_POP_ASP = .  if countryelection == 407
replace voteper_SEC_NAT_ASP = .  if countryelection == 407
replace voteper_REL_ASP =.       if countryelection == 407
replace voteper_OTHERR_ASP =.    if countryelection == 407
replace voteper_OTHERL_ASP = .    if countryelection == 407

*1978*
replace string_PSparties = "Christian Social Party (27.1), Socialist Party (37.8), Liberal (16.7), Walloon Front (8.6, Sec)" if countryelection == 408
replace string_CPparties = "German Speaking Party (0.6), Other (0.6)" if countryelection == 408
replace string_SCparties = "NA" if countryelection == 408
replace string_ASparties = "Communist (6.1, EL), ECOLO (1.1, Green), TPO (0.3, EL), Union for Respect of Labour (1.1, EL)" if countryelection == 408

replace voteper_PSparties = 90.2 if countryelection == 408
replace voteper_CPparties =  1.2 if countryelection == 408
replace voteper_SCparties =  0   if countryelection == 408
replace voteper_ASparties =  8.6 if countryelection == 408

replace voteper_EL_ASP = 7.5       if countryelection == 408
replace voteper_RL_ASP =.        if countryelection == 408
replace voteper_ER_ASP =.        if countryelection == 408
replace voteper_RR_ASP = .       if countryelection == 408
replace voteper_GREEN_ASP = 1.1     if countryelection == 408
replace voteper_PIRATE_ASP = .     if countryelection == 408
replace voteper_MISC_POP_ASP = .  if countryelection == 408
replace voteper_SEC_NAT_ASP = .   if countryelection == 408
replace voteper_REL_ASP =.       if countryelection == 408
replace voteper_OTHERR_ASP =.    if countryelection == 408
replace voteper_OTHERL_ASP = .    if countryelection == 408

*1981*
replace string_PSparties = "Christian Social Party (20.2), Socialist Party (37.2), Liberal (21.2), FDF (5.3), Walloon Rally (1.8)" if countryelection == 409
replace string_CPparties = "Party German Speakers (0.5)" if countryelection == 409
replace string_SCparties = "NA" if countryelection == 409
replace string_ASparties = "Communist (4.5, EL), Worker's Party (0.2, EL), Union for Respect of Labour (3.1, EL), AGALEV (6, Green), National Front (0.1, RR)" if countryelection == 409

replace voteper_PSparties = 85.7 if countryelection == 409
replace voteper_CPparties =  0.5 if countryelection == 409
replace voteper_SCparties =  0   if countryelection == 409
replace voteper_ASparties = 13.9 if countryelection == 409

replace voteper_EL_ASP = 7.8      if countryelection == 409
replace voteper_RL_ASP =.        if countryelection == 409
replace voteper_ER_ASP =.        if countryelection == 409
replace voteper_RR_ASP = 0.1       if countryelection == 409
replace voteper_GREEN_ASP = 6     if countryelection == 409
replace voteper_PIRATE_ASP = .     if countryelection == 409
replace voteper_MISC_POP_ASP = .  if countryelection == 409
replace voteper_SEC_NAT_ASP = .   if countryelection == 409
replace voteper_REL_ASP =.       if countryelection == 409
replace voteper_OTHERR_ASP =.    if countryelection == 409
replace voteper_OTHERL_ASP = .    if countryelection == 409

*1985*
replace string_PSparties = "Christian Social Party (23.1), Socialist Party (40.6), Liberal (23.4)" if countryelection == 410
replace string_CPparties = "Other (2.0, Ind), German Speakers (0.3)" if countryelection == 410
replace string_SCparties = "NA" if countryelection == 410
replace string_ASparties = "Communist (2.7, EL), Worker's Party (0.2, EL), Union for Respect of Labour (1.4, EL), AGALEV (6.2, Green)" if countryelection == 410

replace voteper_PSparties =  87.1 if countryelection == 410
replace voteper_CPparties =   2.3 if countryelection == 410
replace voteper_SCparties =   0   if countryelection == 410
replace voteper_ASparties =  10.6 if countryelection == 410

replace voteper_EL_ASP = 4.3      if countryelection == 410
replace voteper_RL_ASP =.        if countryelection == 410
replace voteper_ER_ASP =.        if countryelection == 410
replace voteper_RR_ASP = .       if countryelection == 410
replace voteper_GREEN_ASP = 6.2     if countryelection == 410
replace voteper_PIRATE_ASP = .     if countryelection == 410
replace voteper_MISC_POP_ASP = .  if countryelection == 410
replace voteper_SEC_NAT_ASP = .   if countryelection == 410
replace voteper_REL_ASP =.       if countryelection == 410
replace voteper_OTHERR_ASP =.    if countryelection == 410
replace voteper_OTHERL_ASP = .    if countryelection == 410

*1987*
replace string_PSparties = "Christian Social Party (23.1), Socialist Party (40.5), Liberal (23.4)" if countryelection == 411
replace string_CPparties = "Other (2.3, Ind), Party German Speakers (0.3)" if countryelection == 411
replace string_SCparties = "NA" if countryelection == 411
replace string_ASparties = "Communist (2.6, EL), Worker's Party (0.3, EL), AGALEV (6.2, Green), RAD-UDRT (1.4, EL)" if countryelection == 411

replace voteper_PSparties = 87.0 if countryelection == 411
replace voteper_CPparties =  2.5 if countryelection == 411
replace voteper_SCparties =  0   if countryelection == 411
replace voteper_ASparties = 10.5 if countryelection == 411

replace voteper_EL_ASP = 4.3      if countryelection == 411
replace voteper_RL_ASP =.        if countryelection == 411
replace voteper_ER_ASP =.        if countryelection == 411
replace voteper_RR_ASP = .      if countryelection == 411
replace voteper_GREEN_ASP = 6.2     if countryelection == 411
replace voteper_PIRATE_ASP = .     if countryelection == 411
replace voteper_MISC_POP_ASP = .  if countryelection == 411
replace voteper_SEC_NAT_ASP = .   if countryelection == 411
replace voteper_REL_ASP =.       if countryelection == 411
replace voteper_OTHERR_ASP =.    if countryelection == 411
replace voteper_OTHERL_ASP = .    if countryelection == 411

*1991*
replace string_PSparties = "Christian Social Party (22.5), Socialist Party (39.2), Liberal (19.8), FDF (1)" if countryelection == 412
replace string_CPparties = "Other (1.2, Ind)" if countryelection == 412
replace string_SCparties = "NA" if countryelection == 412
replace string_ASparties = "Worker's Party (0.5, EL), AGIR (0.6, RR), National Front (1.7, RR), AGALEV (13.5, Green)" if countryelection == 412

replace voteper_PSparties = 82.5 if countryelection == 412
replace voteper_CPparties =  1.2   if countryelection == 412
replace voteper_SCparties =  0   if countryelection == 412
replace voteper_ASparties = 16.3 if countryelection == 412

replace voteper_EL_ASP = 0.5      if countryelection == 412
replace voteper_RL_ASP =.        if countryelection == 412
replace voteper_ER_ASP =.        if countryelection == 412
replace voteper_RR_ASP = 2.3       if countryelection == 412
replace voteper_GREEN_ASP = 13.5     if countryelection == 412
replace voteper_PIRATE_ASP = .     if countryelection == 412
replace voteper_MISC_POP_ASP = .  if countryelection == 412
replace voteper_SEC_NAT_ASP = .   if countryelection == 412
replace voteper_REL_ASP =.       if countryelection == 412
replace voteper_OTHERR_ASP = 3.2    if countryelection == 412
replace voteper_OTHERL_ASP = .    if countryelection == 412

*1995*
replace string_PSparties = "Christian Social Party (22.5), Socialist Party (33.7), Liberal (23.9)" if countryelection == 413
replace string_CPparties = "Other (2.3, Ind), AGALEV (10.3, Green)" if countryelection == 413
replace string_SCparties = "NA" if countryelection == 413
replace string_ASparties = "Worker's Party (0.7, EL), AGIR (0.8, RR), National Front (5.5, RR), Communist (0.3, El)" if countryelection == 413

replace voteper_PSparties = 80.1 if countryelection == 413
replace voteper_CPparties = 12.6 if countryelection == 413
replace voteper_SCparties =  0   if countryelection == 413
replace voteper_ASparties =  7.3 if countryelection == 413

replace voteper_EL_ASP = 1      if countryelection == 413
replace voteper_RL_ASP =.        if countryelection == 413
replace voteper_ER_ASP =.        if countryelection == 413
replace voteper_RR_ASP = 6.3       if countryelection == 413
replace voteper_GREEN_ASP =.     if countryelection == 413
replace voteper_PIRATE_ASP = .     if countryelection == 413
replace voteper_MISC_POP_ASP = .  if countryelection == 413
replace voteper_SEC_NAT_ASP = .   if countryelection == 413
replace voteper_REL_ASP =.       if countryelection == 413
replace voteper_OTHERR_ASP = .    if countryelection == 413
replace voteper_OTHERL_ASP = .    if countryelection == 413

*1999*
replace string_PSparties = "Christian Social Party (16.8), Socialist Party (29.2), Liberal (24.7)" if countryelection == 414
replace string_CPparties = "Other (2.1, Ind), AGALEV (18.3, Green), Vivant (2.5, Lib)" if countryelection == 414
replace string_SCparties = "NA" if countryelection == 414
replace string_ASparties = "Worker's Party (0.5, EL), RAD-URT (1, EL), New Belgian Front (0.8, RR), National Front (4.1, RR)" if countryelection == 414

replace voteper_PSparties = 70.7 if countryelection == 414
replace voteper_CPparties = 22.9 if countryelection == 414
replace voteper_SCparties =  0   if countryelection == 414
replace voteper_ASparties =  6.4 if countryelection == 414

replace voteper_EL_ASP = 1.5      if countryelection == 414
replace voteper_RL_ASP =.        if countryelection == 414
replace voteper_ER_ASP =.        if countryelection == 414
replace voteper_RR_ASP = 4.9       if countryelection == 414
replace voteper_GREEN_ASP =.     if countryelection == 414
replace voteper_PIRATE_ASP = .     if countryelection == 414
replace voteper_MISC_POP_ASP = .  if countryelection == 414
replace voteper_SEC_NAT_ASP = .   if countryelection == 414
replace voteper_REL_ASP =.       if countryelection == 414
replace voteper_OTHERR_ASP =.    if countryelection == 414
replace voteper_OTHERL_ASP = .    if countryelection == 414

*2003*
replace string_PSparties = "Christian Social Party (15.4), Socialist Party (36.4), Liberal (28.4), AGALEV/GROEN (7.5, Green)" if countryelection == 415
replace string_CPparties = "Other (2.8, Ind), Vivant (1.5, Lib)" if countryelection == 415
replace string_SCparties = "NA" if countryelection == 415
replace string_ASparties = "Worker's Party (0.6, EL), Communist (0.3, EL), National Front (5.6, RR), Vlams Blok (0.3, RR), RWF-RBF (1.2, Sec)" if countryelection == 415

replace voteper_PSparties = 87.7 if countryelection == 415
replace voteper_CPparties =  4.3 if countryelection == 415
replace voteper_SCparties =  0   if countryelection == 415
replace voteper_ASparties =  8.0 if countryelection == 415

replace voteper_EL_ASP = 0.9      if countryelection == 415
replace voteper_RL_ASP =.        if countryelection == 415
replace voteper_ER_ASP =.        if countryelection == 415
replace voteper_RR_ASP = 5.9       if countryelection == 415
replace voteper_GREEN_ASP =.     if countryelection == 415
replace voteper_PIRATE_ASP = .     if countryelection == 415
replace voteper_MISC_POP_ASP = .  if countryelection == 415
replace voteper_SEC_NAT_ASP = 1.2   if countryelection == 415
replace voteper_REL_ASP =.       if countryelection == 415
replace voteper_OTHERR_ASP =.    if countryelection == 415
replace voteper_OTHERL_ASP = .    if countryelection == 415

*2007*
replace string_PSparties = "Christian Social Party (16.2), Socialist Party (29.5), Liberal (31.2), AGALEV/GROEN (12.8, Green)" if countryelection == 416
replace string_CPparties = "Other (1.5, Ind)" if countryelection == 416
replace string_SCparties = "NA" if countryelection == 416
replace string_ASparties = "Worker's Party (0.7, EL), Communist (0.8, EL), New Front Belgium (0.4, RR), National Front (5.6, RR), Vlams Blok (0.1, RR), RWF-RBF (1.2, Sec)" if countryelection == 416

replace voteper_PSparties = 89.7 if countryelection == 416
replace voteper_CPparties =  1.5 if countryelection == 416
replace voteper_SCparties =  0   if countryelection == 416
replace voteper_ASparties =  8.8 if countryelection == 416

replace voteper_EL_ASP = 1.5      if countryelection == 416
replace voteper_RL_ASP =.        if countryelection == 416
replace voteper_ER_ASP =.        if countryelection == 416
replace voteper_RR_ASP = 6.1       if countryelection == 416
replace voteper_GREEN_ASP =.     if countryelection == 416
replace voteper_PIRATE_ASP = .     if countryelection == 416
replace voteper_MISC_POP_ASP = .  if countryelection == 416
replace voteper_SEC_NAT_ASP = 1.2   if countryelection == 416
replace voteper_REL_ASP =.       if countryelection == 416
replace voteper_OTHERR_ASP = .    if countryelection == 416
replace voteper_OTHERL_ASP = .    if countryelection == 416

*2010*
replace string_PSparties = "Christian Social Party (14.6), Socialist Party (37.6), Liberal (22.2), AGALEV/GROEN (12.3, Green)" if countryelection == 417
replace string_CPparties = "Other (3.8, Ind)" if countryelection == 417
replace string_SCparties = "NA" if countryelection == 417
replace string_ASparties = "Worker's Party (1.9, RL), Left Front (0.8, RL), People's Party (3.1, OR), National Front (2, RR), RWF-RBF (1.7, Sec)" if countryelection == 417

replace voteper_PSparties = 86.7 if countryelection == 417
replace voteper_CPparties =  3.8   if countryelection == 417
replace voteper_SCparties =  0 if countryelection == 417
replace voteper_ASparties =  9.5 if countryelection == 417

replace voteper_EL_ASP = .      if countryelection == 417
replace voteper_RL_ASP = 2.7        if countryelection == 417
replace voteper_ER_ASP =.        if countryelection == 417
replace voteper_RR_ASP = 2       if countryelection == 417
replace voteper_GREEN_ASP =.     if countryelection == 417
replace voteper_PIRATE_ASP = .     if countryelection == 417
replace voteper_MISC_POP_ASP = .  if countryelection == 417
replace voteper_SEC_NAT_ASP = 1.7   if countryelection == 417
replace voteper_REL_ASP =.       if countryelection == 417
replace voteper_OTHERR_ASP = 3.1    if countryelection == 417
replace voteper_OTHERL_ASP = .    if countryelection == 417

*2014*
replace string_PSparties = "Christian Social Party (14), Socialist Party (32), Liberal (25.8), FDF (2.4), AGALEV/GROEN (8.2, Green)" if countryelection == 418
replace string_CPparties = "Other (4.2, Ind)" if countryelection == 418
replace string_SCparties = "NA" if countryelection == 418
replace string_ASparties = "Worker's Party (5.5, RL), Left Struggle (0.2, RL), Pirate Party (0.5, Pirate), People's Party (4.5, OR), Rise up (2.3, Islam), RFW (0.4, Sec)" if countryelection == 418

replace voteper_PSparties = 82.4 if countryelection == 418
replace voteper_CPparties =  4.2 if countryelection == 418
replace voteper_SCparties =  0   if countryelection == 418
replace voteper_ASparties = 13.4 if countryelection == 418

replace voteper_EL_ASP = .      if countryelection == 418
replace voteper_RL_ASP = 5.7       if countryelection == 418
replace voteper_ER_ASP =.        if countryelection == 418
replace voteper_RR_ASP = .       if countryelection == 418
replace voteper_GREEN_ASP =.     if countryelection == 418
replace voteper_PIRATE_ASP = 0.5     if countryelection == 418
replace voteper_MISC_POP_ASP = .  if countryelection == 418
replace voteper_SEC_NAT_ASP = 0.4   if countryelection == 418
replace voteper_REL_ASP = 2.3       if countryelection == 418
replace voteper_OTHERR_ASP = 4.5    if countryelection == 418
replace voteper_OTHERL_ASP = .    if countryelection == 418


format %150s string_PSparties 

gen master_id = countryelection
order master_id, after(countryelection)

gen year = real(substr(string_date, -4, 4))
label variable year "Election year (Numeric)"
order year, after(edate)



************************************* lagged DV **********************************

gen lag_PS =.
gen lag_CP =.
gen lag_SCP =.
gen lag_ASP =.
gen lag_EL =.
gen lag_RL =.
gen lag_ER =.
gen lag_RR =.
gen lag_GREEN =.
gen lag_PIRATE =.
gen lag_MISCPOP =.
gen lag_SECNAT =.
gen lag_REL =.
gen lag_OTHERR =.
gen lag_OTHERL =.

bysort FEcountry (edate): replace lag_PS =  voteper_PSparties[_n-1]
bysort FEcountry (edate): replace lag_CP =  voteper_CPparties[_n-1]
bysort FEcountry (edate): replace lag_SCP =  voteper_SCparties[_n-1]
bysort FEcountry (edate): replace lag_ASP =  voteper_ASparties[_n-1]

bysort FEcountry (edate): replace lag_EL =  voteper_EL_ASP[_n-1]
bysort FEcountry (edate): replace lag_RL =  voteper_RL_ASP[_n-1]
bysort FEcountry (edate): replace lag_ER =  voteper_ER_ASP[_n-1]
bysort FEcountry (edate): replace lag_RR =  voteper_RR_ASP[_n-1]
bysort FEcountry (edate): replace lag_GREEN =  voteper_GREEN_ASP[_n-1]
bysort FEcountry (edate): replace lag_PIRATE =  voteper_PIRATE_ASP[_n-1]
bysort FEcountry (edate): replace lag_MISCPOP =  voteper_MISC_POP_ASP[_n-1]
bysort FEcountry (edate): replace lag_SECNAT =  voteper_SEC_NAT_ASP[_n-1]
bysort FEcountry (edate): replace lag_REL =  voteper_REL_ASP[_n-1]
bysort FEcountry (edate): replace lag_OTHERR =  voteper_OTHERR_ASP[_n-1]
bysort FEcountry (edate): replace lag_OTHERL =  voteper_OTHERL_ASP[_n-1]

label variable lag_PS "Lagged Pro-System Vote (Previous Election)"
label variable lag_CP "Lagged Complementary Party Vote (Previous Election)"
label variable lag_SCP "Lagged System-Critical Vote (Previous Election)"
label variable lag_ASP "Lagged Anti-System Vote (Previous Election)"
label variable lag_EL "Lagged AS Extreme-left Vote (Previous Election)"
label variable lag_RL "Lagged AS Radical left Vote (Previous Election)"    
label variable lag_ER "Lagged AS Extreme-right Vote (Previous Election)"
label variable lag_RR "Lagged AS Radical right Vote (Previous Election)"
label variable lag_GREEN "Lagged AS Green Vote (Previous Election)"
label variable lag_PIRATE "Lagged AS Pirate Vote (Previous Election)"
label variable lag_MISCPOP "Lagged AS MiscPop Vote (Previous Election)"
label variable lag_SECNAT "Lagged AS Sec-Nat Vote (Previous Election)"
label variable lag_REL "Lagged AS Relgious Vote (Previous Election)"
label variable lag_OTHERR "Lagged AS Other-Right Vote (Previous Election)"
label variable lag_OTHERL "Lagged AS Other-Left Vote (Previous Election)"

order voteper_PSparties lag_PS string_CPparties voteper_CPparties lag_CP string_SCparties voteper_SCparties lag_SCP ///
string_ASparties voteper_ASparties lag_ASP voteper_EL_ASP lag_EL voteper_RL_ASP lag_RL voteper_ER_ASP lag_ER voteper_RR_ASP ///
lag_RR voteper_GREEN_ASP lag_GREEN voteper_PIRATE_ASP lag_PIRATE voteper_MISC_POP_ASP lag_MISCPOP voteper_SEC_NAT_ASP lag_SECNAT ///
voteper_REL_ASP lag_REL voteper_OTHERR_ASP lag_OTHERR voteper_OTHERL_ASP lag_OTHERL, after( string_PSparties)


*** Replace Lag_ASP for First Elections. Use same coding structure as above ***

replace lag_ASP = 0.9  if countryelection == 1 //* Australia (Coms)
replace lag_ASP = 14.9  if countryelection == 180 //* Ireland (CNP/CNT/MRP)
replace lag_ASP = 8.1   if countryelection == 379 //* Flanders (Flemish Concentration/Coms)
replace lag_ASP = 35.8  if countryelection == 199 //* Italy (PDF/MNP/ISM)
replace lag_ASP = 9.3  if countryelection == 240 //* Netherlands Communists / Reformed PP / Reformed PL
replace lag_ASP = 26.2  if countryelection == 110 //* France (Gaulist Union / RPL / PRL all oppose constitution)
replace lag_ASP = 9.5  if countryelection == 344 //* Switzerland 
replace lag_ASP = 1.4  if countryelection == 361 //* UK
replace lag_ASP = 6.8  if countryelection == 67 // Den (Coms)
replace lag_ASP = 16.8  if countryelection == 27 //* Austria (Coms and Electoral Indeps)
replace lag_ASP = 14.3  if countryelection == 215 //* Lux (Coms)
replace lag_ASP = 18.6  if countryelection == 126 //* Germany (Coms, BP, DP, WAV, Rights Party)
replace lag_ASP = 12.6  if countryelection == 399 //* Wallonia (Coms)
replace lag_ASP = 0.3  if countryelection == 259 //* NZ (Coms)
replace lag_ASP = 0  if countryelection == 92 //* Finland (Coms already in gov)
replace lag_ASP = 6.8  if countryelection == 281 //* Norway (Communists and Society Party)
replace lag_ASP = 6.3  if countryelection == 324 //* Sweden (Coms)
replace lag_ASP = 17.5  if countryelection == 46 //* Canada (CCF, SOcCred, Lab-Prog)
replace lag_ASP = 0  if countryelection == 160 //* Iceland


************************************************************************************** IVs **********************************************************************************************


* 1: GDP Growth Rates + Trade Openness (source: Penn World Table v.9.1 (Feenstra et al 2015) *


* Get/Save Data **

save "$data1\Study1Combined.dta", replace
clear
use "$data1\pwt91.dta" //* Penn World Table v9.1 (Downloaded: 04/11/19).

keep countrycode country year pop rgdpna csh_x csh_m
encode country, gen(country_n) 


* Convert back to raw figures

replace pop = pop * 1000000
replace rgdpna = rgdpna * 1000000  //* RGDPNA = Real GDP at constant national prices (in Millions of 2011 US Dollars). Best for studies comparing growth rates across countries over time. 

* Make per capita 
gen PC_rgdpna = (rgdpna/pop) 
bysort country_n (year) : gen lag_rgdpnaPC =  PC_rgdpna[_n-1] //* Lagged GDP per Capita 

* Lagged Per Capita Growth Rates *
bysort country_n (year) : gen lag2GR_rgdpnaPC = ((PC_rgdpna[_n-1] - PC_rgdpna[_n-2])/ PC_rgdpna[_n-2]) * 100 //* Lagged GDP per Capita Annual % Growth Rate (i.e. 2009 lagged GDP growth = growth between end of 2007 and end of 2008)

* Trade Openness *
gen abs_csh_m = abs(csh_m )  //* Absolute Share of Merchandise Imports at Current PPPs
gen abs_csh_x = abs(csh_x )  //* Absolute Share of Merchandise Exports at Current PPPs
gen openness =.
replace openness = abs_csh_x + abs_csh_m  //* Same method as Vishesh Agarwal et al (2017).
replace openness = openness * 100 //* As a %.

label variable openness "Trade Openness Measure (PwT, v.9.1): Share of Merchandise Imports + Exports at Current PPPs"

gen lag_openness =.
label variable lag_openness "Year Lagged Trade Openness Measure"
bysort country_n (year) : replace lag_openness = openness[_n - 1] 

* If missing missing data, use most recently available GDP growth (only affects 11 elections held in 1950/51).

bysort country_n (year) : replace lag2GR_rgdpnaPC = ((PC_rgdpna[_n] - PC_rgdpna[_n-1])/ PC_rgdpna[_n-1]) * 100 if lag2GR_rgdpnaPC ==. 
bysort country_n (year) : replace lag_rgdpnaPC = lag_rgdpnaPC[_n +1] if lag_rgdpnaPC ==.
bysort country_n (year) : replace lag2GR_rgdpnaPC = lag2GR_rgdpnaPC[_n +1] if lag2GR_rgdpnaPC ==.
bysort country_n (year) : replace openness = openness[_n +1] if openness ==.
bysort country_n (year) : replace lag_openness = openness if lag_openness == .
bysort country_n (year) : replace lag_openness = openness[_n+1] if lag_openness == .

* Germany
* bysort country_n (year) : gen GR_rgdpnaPC = ((PC_rgdpna[_n] - PC_rgdpna[_n-1])/ PC_rgdpna[_n-1]) * 100 




//* Ireland (2016) Correction.

  * Note: Irish lagged GDP growth for the 2016 election year (i.e. the growth in GDP per capita recorded between 2014 and 2015) is recorded as 25.4%.
  *       While this figure does not appear to be the result of a miscalculation (the World Bank figures give something very similar), it is clearly a statistical outlier.
  *       In my subsample of advanced democracies in election year, the average growth is 2.3%, the next highest to Ireland in 2016 is 11.3% (Austria in 1956).
  *       Ireland's 2016 lagged growth rate is over 8 standard deviations above from my sample mean. 
  *       Within the entire Penn World Table dataset of 10,000 cases (1950-2017), Ireland's 2016 figure is within the top 0.05% highest yearly growth figures (the other examples are nearly all developing countries or post-war years). 
  *       The problem of Ireland's apparantly superhigh GDP growth figures has been widely commented on (FitzGerald 2019; Inman 2016; OECD 2016; Regan 2016;  Taylor 2016).
  *       The figure is misleadingly high as overseas companies were included in the value of the corporate sector (i.e. foreign companies switched their base to Ireland this year - due to its low corporate tax rates -, this pushing up the value of the state's balance sheet). 
   *      Economist John FitzGerald calls it a "distortion". 
  *       Solution here: Simply average the economic values between 2011 and 2016 election.
  
  replace lag2GR_rgdpnaPC = ((2.197556257247925 + -.2951190769672394 + 1.555244207382202 + 8.22713565826416 + 25.3945426940918)/5) if country_n == 84 & year == 2016
  replace lag_rgdpnaPC    = ((48321.33203125 + 48178.7265625 + 48928.0234375 + 52953.3984375 + 66400.671875)/5)                    if country_n == 84 & year == 2016
  replace openness        = ((110.494384765625 + 109.3016052246094 + 106.6570053100586 + 95.88239288330078 + 95.03926086425781)/5) if country_n == 84 & year == 2016
  replace lag_openness    = ((117.2143478393555 + 110.494384765625 + 109.3016052246094 + 106.6570053100586 + 95.88239288330078)/5) if country_n == 84 & year == 2016
  
gen master_id =.

replace master_id = 1   if country_n  == 9  & year == 1951 //* Australia
replace master_id = 2   if country_n  == 9  & year == 1954
replace master_id = 3   if country_n  == 9  & year == 1955
replace master_id = 4   if country_n  == 9  & year == 1958
replace master_id = 5   if country_n  == 9  & year == 1961
replace master_id = 6   if country_n  == 9  & year == 1963
replace master_id = 7   if country_n  == 9  & year == 1966
replace master_id = 8   if country_n  == 9  & year == 1969
replace master_id = 9   if country_n  == 9  & year == 1972
replace master_id = 10  if country_n  == 9  & year == 1974
replace master_id = 11  if country_n  == 9  & year == 1975
replace master_id = 12  if country_n  == 9  & year == 1977
replace master_id = 13  if country_n  == 9  & year == 1980
replace master_id = 14  if country_n  == 9  & year == 1983
replace master_id = 15  if country_n  == 9  & year == 1984
replace master_id = 16  if country_n  == 9  & year == 1987
replace master_id = 17  if country_n  == 9  & year == 1990
replace master_id = 18  if country_n  == 9  & year == 1993
replace master_id = 19  if country_n  == 9  & year == 1996
replace master_id = 20  if country_n  == 9  & year == 1998
replace master_id = 21  if country_n  == 9  & year == 2001
replace master_id = 22  if country_n  == 9  & year == 2004
replace master_id = 23  if country_n  == 9  & year == 2007
replace master_id = 24  if country_n  == 9  & year == 2010
replace master_id = 25  if country_n  == 9  & year == 2013
replace master_id = 26  if country_n  == 9  & year == 2016

replace master_id = 27  if country_n  == 10  & year == 1953 //* Austria
replace master_id = 28  if country_n  == 10  & year == 1956
replace master_id = 29  if country_n  == 10  & year == 1959
replace master_id = 30  if country_n  == 10  & year == 1962
replace master_id = 31  if country_n  == 10  & year == 1966
replace master_id = 32  if country_n  == 10  & year == 1970
replace master_id = 33  if country_n  == 10  & year == 1971
replace master_id = 34  if country_n  == 10  & year == 1975
replace master_id = 35  if country_n  == 10  & year == 1979
replace master_id = 36  if country_n  == 10  & year == 1983
replace master_id = 37  if country_n  == 10  & year == 1986
replace master_id = 38  if country_n  == 10  & year == 1990
replace master_id = 39  if country_n  == 10  & year == 1994
replace master_id = 40  if country_n  == 10  & year == 1995
replace master_id = 41  if country_n  == 10  & year == 1999
replace master_id = 42  if country_n  == 10  & year == 2002
replace master_id = 43  if country_n  == 10  & year == 2006
replace master_id = 44  if country_n  == 10  & year == 2008
replace master_id = 45  if country_n  == 10  & year == 2013

replace master_id = 46  if country_n  == 34 & year == 1953 //* Canada
replace master_id = 47  if country_n  == 34 & year == 1957
replace master_id = 48  if country_n  == 34 & year == 1958
replace master_id = 49  if country_n  == 34 & year == 1962
replace master_id = 50  if country_n  == 34 & year == 1963
replace master_id = 51  if country_n  == 34 & year == 1965
replace master_id = 52  if country_n  == 34 & year == 1968
replace master_id = 53  if country_n  == 34 & year == 1972
replace master_id = 54  if country_n  == 34 & year == 1974
replace master_id = 55  if country_n  == 34 & year == 1979 
replace master_id = 56  if country_n  == 34 & year == 1980 
replace master_id = 57  if country_n  == 34 & year == 1984
replace master_id = 58  if country_n  == 34 & year == 1988
replace master_id = 59  if country_n  == 34 & year == 1993
replace master_id = 60  if country_n  == 34 & year == 1997
replace master_id = 61  if country_n  == 34 & year == 2000
replace master_id = 62  if country_n  == 34 & year == 2004
replace master_id = 63  if country_n  == 34 & year == 2006
replace master_id = 64  if country_n  == 34 & year == 2008
replace master_id = 65  if country_n  == 34 & year == 2011
replace master_id = 66  if country_n  == 34 & year == 2015
						
replace master_id = 67  if country_n  == 52 & year == 1950 //* Denmark
replace master_id = 68  if country_n  == 52 & year == 1953
//* 2 elections in 1953, add second later.
replace master_id = 70  if country_n  == 52 & year == 1957
replace master_id = 71  if country_n  == 52 & year == 1960
replace master_id = 72  if country_n  == 52 & year == 1964
replace master_id = 73  if country_n  == 52 & year == 1966
replace master_id = 74  if country_n  == 52 & year == 1968
replace master_id = 75  if country_n  == 52 & year == 1971
replace master_id = 76  if country_n  == 52 & year == 1973 
replace master_id = 77  if country_n  == 52 & year == 1975 
replace master_id = 78  if country_n  == 52 & year == 1977
replace master_id = 79  if country_n  == 52 & year == 1979
replace master_id = 80  if country_n  == 52 & year == 1981
replace master_id = 81  if country_n  == 52 & year == 1984
replace master_id = 82  if country_n  == 52 & year == 1987
replace master_id = 83  if country_n  == 52 & year == 1988
replace master_id = 84  if country_n  == 52 & year == 1990
replace master_id = 85  if country_n  == 52 & year == 1994
replace master_id = 86  if country_n  == 52 & year == 1998
replace master_id = 87  if country_n  == 52 & year == 2001						
replace master_id = 88  if country_n  == 52 & year == 2005
replace master_id = 89  if country_n  == 52 & year == 2007
replace master_id = 90  if country_n  == 52 & year == 2011
replace master_id = 91  if country_n  == 52 & year == 2015									
																
replace master_id = 92 if country_n  == 64 & year == 1951 //* Finland
replace master_id = 93 if country_n  == 64 & year == 1954
replace master_id = 94 if country_n  == 64 & year == 1958
replace master_id = 95 if country_n  == 64 & year == 1962
replace master_id = 96 if country_n  == 64 & year == 1966
replace master_id = 97 if country_n  == 64 & year == 1970
replace master_id = 98 if country_n  == 64 & year == 1972
replace master_id = 99 if country_n  == 64 & year == 1975
replace master_id = 100 if country_n  == 64 & year == 1979
replace master_id = 101 if country_n  == 64 & year == 1983 
replace master_id = 102 if country_n  == 64 & year == 1987 
replace master_id = 103 if country_n  == 64 & year == 1991
replace master_id = 104 if country_n  == 64 & year == 1995
replace master_id = 105 if country_n  == 64 & year == 1999
replace master_id = 106 if country_n  == 64 & year == 2003
replace master_id = 107 if country_n  == 64 & year == 2007
replace master_id = 108 if country_n  == 64 & year == 2011
replace master_id = 109 if country_n  == 64 & year == 2015

replace master_id = 110 if country_n  == 65 & year == 1951 //* France
replace master_id = 111 if country_n  == 65 & year == 1956
replace master_id = 112 if country_n  == 65 & year == 1958
replace master_id = 113 if country_n  == 65 & year == 1962
replace master_id = 114 if country_n  == 65 & year == 1967
replace master_id = 115 if country_n  == 65 & year == 1968
replace master_id = 116 if country_n  == 65 & year == 1973
replace master_id = 117 if country_n  == 65 & year == 1978
replace master_id = 118 if country_n  == 65 & year == 1981
replace master_id = 119 if country_n  == 65 & year == 1986
replace master_id = 120 if country_n  == 65 & year == 1988 
replace master_id = 121 if country_n  == 65 & year == 1993 
replace master_id = 122 if country_n  == 65 & year == 1997
replace master_id = 123 if country_n  == 65 & year == 2002
replace master_id = 124 if country_n  == 65 & year == 2007
replace master_id = 125 if country_n  == 65 & year == 2012


replace master_id = 126 if country_n  == 69 & year == 1953 //* Germany
replace master_id = 127 if country_n  == 69 & year == 1957
replace master_id = 128 if country_n  == 69 & year == 1961
replace master_id = 129 if country_n  == 69 & year == 1965
replace master_id = 130 if country_n  == 69 & year == 1969
replace master_id = 131 if country_n  == 69 & year == 1972
replace master_id = 132 if country_n  == 69 & year == 1976
replace master_id = 133 if country_n  == 69 & year == 1980
replace master_id = 134 if country_n  == 69 & year == 1983
replace master_id = 135 if country_n  == 69 & year == 1987
replace master_id = 136 if country_n  == 69 & year == 1990 
replace master_id = 137 if country_n  == 69 & year == 1994 
replace master_id = 138 if country_n  == 69 & year == 1998
replace master_id = 139 if country_n  == 69 & year == 2002
replace master_id = 140 if country_n  == 69 & year == 2005
replace master_id = 141 if country_n  == 69 & year == 2009
replace master_id = 142 if country_n  == 69 & year == 2013

replace master_id = 143 if country_n  == 71 & year == 1974 //* Greece
replace master_id = 144 if country_n  == 71 & year == 1977
replace master_id = 145 if country_n  == 71 & year == 1981
replace master_id = 146 if country_n  == 71 & year == 1985 
replace master_id = 147 if country_n  == 71 & year == 1989 
//* Two elections in 1989, add second later.
replace master_id = 149 if country_n  == 71 & year == 1990
replace master_id = 150 if country_n  == 71 & year == 1993
replace master_id = 151 if country_n  == 71 & year == 1996
replace master_id = 152 if country_n  == 71 & year == 2000
replace master_id = 153 if country_n  == 71 & year == 2004
replace master_id = 154 if country_n  == 71 & year == 2007
replace master_id = 155 if country_n  == 71 & year == 2009
replace master_id = 156 if country_n  == 71 & year == 2012
//* Two elections in 2012, add second later.
replace master_id = 158 if country_n  == 71 & year == 2015
//* Two elections in 2015, add second later.

replace master_id = 160 if country_n  == 79 & year == 1953 //* Iceland
replace master_id = 161 if country_n  == 79 & year == 1956
replace master_id = 162 if country_n  == 79 & year == 1959
//* Two elections in 1959, add second later.
replace master_id = 164 if country_n  == 79 & year == 1963
replace master_id = 165 if country_n  == 79 & year == 1967
replace master_id = 166 if country_n  == 79 & year == 1971
replace master_id = 167 if country_n  == 79 & year == 1974
replace master_id = 168 if country_n  == 79 & year == 1978
replace master_id = 169 if country_n  == 79 & year == 1979 
replace master_id = 170 if country_n  == 79 & year == 1983 
replace master_id = 171 if country_n  == 79 & year == 1987
replace master_id = 172 if country_n  == 79 & year == 1991
replace master_id = 173 if country_n  == 79 & year == 1995
replace master_id = 174 if country_n  == 79 & year == 1999
replace master_id = 175 if country_n  == 79 & year == 2003
replace master_id = 176 if country_n  == 79 & year == 2007
replace master_id = 177 if country_n  == 79 & year == 2009
replace master_id = 178 if country_n  == 79 & year == 2013
replace master_id = 179 if country_n  == 79 & year == 2016


replace master_id = 180 if country_n  == 84 & year == 1951 //* Ireland
replace master_id = 181 if country_n  == 84 & year == 1954
replace master_id = 182 if country_n  == 84 & year == 1957
replace master_id = 183 if country_n  == 84 & year == 1961
replace master_id = 184 if country_n  == 84 & year == 1965
replace master_id = 185 if country_n  == 84 & year == 1969
replace master_id = 186 if country_n  == 84 & year == 1973
replace master_id = 187 if country_n  == 84 & year == 1977
replace master_id = 188 if country_n  == 84 & year == 1981
replace master_id = 189 if country_n  == 84 & year == 1982
// Two elections in 1982, add the second later.
replace master_id = 191 if country_n  == 84 & year == 1987 
replace master_id = 192 if country_n  == 84 & year == 1989
replace master_id = 193 if country_n  == 84 & year == 1992
replace master_id = 194 if country_n  == 84 & year == 1997
replace master_id = 195 if country_n  == 84 & year == 2002
replace master_id = 196 if country_n  == 84 & year == 2007
replace master_id = 197 if country_n  == 84 & year == 2011
replace master_id = 198 if country_n  == 84 & year == 2016


replace master_id = 199 if country_n  == 86 & year == 1953 //* Italy
replace master_id = 200 if country_n  == 86 & year == 1958
replace master_id = 201 if country_n  == 86 & year == 1963
replace master_id = 202 if country_n  == 86 & year == 1968
replace master_id = 203 if country_n  == 86 & year == 1972
replace master_id = 204 if country_n  == 86 & year == 1976
replace master_id = 205 if country_n  == 86 & year == 1979
replace master_id = 206 if country_n  == 86 & year == 1983
replace master_id = 207 if country_n  == 86 & year == 1987
replace master_id = 208 if country_n  == 86 & year == 1992
replace master_id = 209 if country_n  == 86 & year == 1994 
replace master_id = 210 if country_n  == 86 & year == 1996 
replace master_id = 211 if country_n  == 86 & year == 2001
replace master_id = 212 if country_n  == 86 & year == 2006
replace master_id = 213 if country_n  == 86 & year == 2008
replace master_id = 214 if country_n  == 86 & year == 2013


replace master_id = 215 if country_n  == 100 & year == 1951 //* Luxembourg
replace master_id = 216 if country_n  == 100 & year == 1954
replace master_id = 217 if country_n  == 100 & year == 1959
replace master_id = 218 if country_n  == 100 & year == 1964
replace master_id = 219 if country_n  == 100 & year == 1968
replace master_id = 220 if country_n  == 100 & year == 1974
replace master_id = 221 if country_n  == 100 & year == 1979
replace master_id = 222 if country_n  == 100 & year == 1984
replace master_id = 223 if country_n  == 100 & year == 1989
replace master_id = 224 if country_n  == 100 & year == 1994 
replace master_id = 225 if country_n  == 100 & year == 1999 
replace master_id = 226 if country_n  == 100 & year == 2004
replace master_id = 227 if country_n  == 100 & year == 2009
replace master_id = 228 if country_n  == 100 & year == 2013


replace master_id = 229 if country_n  == 106 & year == 1966 //* Malta
replace master_id = 230 if country_n  == 106 & year == 1971
replace master_id = 231 if country_n  == 106 & year == 1976
replace master_id = 232 if country_n  == 106 & year == 1981
replace master_id = 233 if country_n  == 106 & year == 1987
replace master_id = 234 if country_n  == 106 & year == 1992
replace master_id = 235 if country_n  == 106 & year == 1996
replace master_id = 236 if country_n  == 106 & year == 1998
replace master_id = 237 if country_n  == 106 & year == 2003
replace master_id = 238 if country_n  == 106 & year == 2008
replace master_id = 239 if country_n  == 106 & year == 2013


replace master_id = 240 if country_n  == 118 & year == 1952 //* Netherlands
replace master_id = 241 if country_n  == 118 & year == 1956
replace master_id = 242 if country_n  == 118 & year == 1959
replace master_id = 243 if country_n  == 118 & year == 1963
replace master_id = 244 if country_n  == 118 & year == 1967
replace master_id = 245 if country_n  == 118 & year == 1971
replace master_id = 246 if country_n  == 118 & year == 1972
replace master_id = 247 if country_n  == 118 & year == 1977
replace master_id = 248 if country_n  == 118 & year == 1981
replace master_id = 249 if country_n  == 118 & year == 1982 
replace master_id = 250 if country_n  == 118 & year == 1986 
replace master_id = 251 if country_n  == 118 & year == 1989
replace master_id = 252 if country_n  == 118 & year == 1994
replace master_id = 253 if country_n  == 118 & year == 1998
replace master_id = 254 if country_n  == 118 & year == 2002
replace master_id = 255 if country_n  == 118 & year == 2003
replace master_id = 256 if country_n  == 118 & year == 2006
replace master_id = 257 if country_n  == 118 & year == 2010
replace master_id = 258 if country_n  == 118 & year == 2012


replace master_id = 259 if country_n  == 119 & year == 1951 //* New Zealand
replace master_id = 260 if country_n  == 119 & year == 1954
replace master_id = 261 if country_n  == 119 & year == 1957
replace master_id = 262 if country_n  == 119 & year == 1960
replace master_id = 263 if country_n  == 119 & year == 1963
replace master_id = 264 if country_n  == 119 & year == 1966
replace master_id = 265 if country_n  == 119 & year == 1969
replace master_id = 266 if country_n  == 119 & year == 1972
replace master_id = 267 if country_n  == 119 & year == 1975
replace master_id = 268 if country_n  == 119 & year == 1978 
replace master_id = 269 if country_n  == 119 & year == 1981 
replace master_id = 270 if country_n  == 119 & year == 1984
replace master_id = 271 if country_n  == 119 & year == 1987
replace master_id = 272 if country_n  == 119 & year == 1990
replace master_id = 273 if country_n  == 119 & year == 1993
replace master_id = 274 if country_n  == 119 & year == 1996
replace master_id = 275 if country_n  == 119 & year == 1999
replace master_id = 276 if country_n  == 119 & year == 2002
replace master_id = 277 if country_n  == 119 & year == 2005
replace master_id = 278 if country_n  == 119 & year == 2008
replace master_id = 279 if country_n  == 119 & year == 2011						
replace master_id = 280 if country_n  == 119 & year == 2014


replace master_id = 281 if country_n  == 124 & year == 1953 //* Norway
replace master_id = 282 if country_n  == 124 & year == 1957
replace master_id = 283 if country_n  == 124 & year == 1961
replace master_id = 284 if country_n  == 124 & year == 1965
replace master_id = 285 if country_n  == 124 & year == 1969
replace master_id = 286 if country_n  == 124 & year == 1973
replace master_id = 287 if country_n  == 124 & year == 1977
replace master_id = 288 if country_n  == 124 & year == 1981
replace master_id = 289 if country_n  == 124 & year == 1985
replace master_id = 290 if country_n  == 124 & year == 1989 
replace master_id = 291 if country_n  == 124 & year == 1993 
replace master_id = 292 if country_n  == 124 & year == 1997
replace master_id = 293 if country_n  == 124 & year == 2001
replace master_id = 294 if country_n  == 124 & year == 2005
replace master_id = 295 if country_n  == 124 & year == 2009
replace master_id = 296 if country_n  == 124 & year == 2013


replace master_id = 297 if country_n  == 132 & year == 1976 //* Portugal
replace master_id = 298 if country_n  == 132 & year == 1979
replace master_id = 299 if country_n  == 132 & year == 1980
replace master_id = 300 if country_n  == 132 & year == 1983
replace master_id = 301 if country_n  == 132 & year == 1985
replace master_id = 302 if country_n  == 132 & year == 1987
replace master_id = 303 if country_n  == 132 & year == 1991
replace master_id = 304 if country_n  == 132 & year == 1995
replace master_id = 305 if country_n  == 132 & year == 1999
replace master_id = 306 if country_n  == 132 & year == 2002
replace master_id = 307 if country_n  == 132 & year == 2005
replace master_id = 308 if country_n  == 132 & year == 2009 
replace master_id = 309 if country_n  == 132 & year == 2011 
replace master_id = 310 if country_n  == 132 & year == 2015


replace master_id = 311 if country_n  == 152 & year == 1977 //* Spain
replace master_id = 312 if country_n  == 152 & year == 1979
replace master_id = 313 if country_n  == 152 & year == 1982
replace master_id = 314 if country_n  == 152 & year == 1986
replace master_id = 315 if country_n  == 152 & year == 1989
replace master_id = 316 if country_n  == 152 & year == 1993
replace master_id = 317 if country_n  == 152 & year == 1996
replace master_id = 318 if country_n  == 152 & year == 2000
replace master_id = 319 if country_n  == 152 & year == 2004
replace master_id = 320 if country_n  == 152 & year == 2008
replace master_id = 321 if country_n  == 152 & year == 2011
replace master_id = 322 if country_n  == 152 & year == 2015 
replace master_id = 323 if country_n  == 152 & year == 2016 


replace master_id = 324 if country_n  == 158 & year == 1952 //* Sweden
replace master_id = 325 if country_n  == 158 & year == 1956
replace master_id = 326 if country_n  == 158 & year == 1958
replace master_id = 327 if country_n  == 158 & year == 1960
replace master_id = 328 if country_n  == 158 & year == 1964
replace master_id = 329 if country_n  == 158 & year == 1968
replace master_id = 330 if country_n  == 158 & year == 1970
replace master_id = 331 if country_n  == 158 & year == 1973
replace master_id = 332 if country_n  == 158 & year == 1976
replace master_id = 333 if country_n  == 158 & year == 1979
replace master_id = 334 if country_n  == 158 & year == 1982 
replace master_id = 335 if country_n  == 158 & year == 1985 
replace master_id = 336 if country_n  == 158 & year == 1988
replace master_id = 337 if country_n  == 158 & year == 1991
replace master_id = 338 if country_n  == 158 & year == 1994
replace master_id = 339 if country_n  == 158 & year == 1998
replace master_id = 340 if country_n  == 158 & year == 2002
replace master_id = 341 if country_n  == 158 & year == 2006
replace master_id = 342 if country_n  == 158 & year == 2010
replace master_id = 343 if country_n  == 158 & year == 2014


replace master_id = 344 if country_n  == 159 & year == 1951 //* Switzerland
replace master_id = 345 if country_n  == 159 & year == 1955
replace master_id = 346 if country_n  == 159 & year == 1959
replace master_id = 347 if country_n  == 159 & year == 1963
replace master_id = 348 if country_n  == 159 & year == 1967
replace master_id = 349 if country_n  == 159 & year == 1971
replace master_id = 350 if country_n  == 159 & year == 1975
replace master_id = 351 if country_n  == 159 & year == 1979
replace master_id = 352 if country_n  == 159 & year == 1983
replace master_id = 353 if country_n  == 159 & year == 1987
replace master_id = 354 if country_n  == 159 & year == 1991 
replace master_id = 355 if country_n  == 159 & year == 1995 
replace master_id = 356 if country_n  == 159 & year == 1999
replace master_id = 357 if country_n  == 159 & year == 2003
replace master_id = 358 if country_n  == 159 & year == 2007
replace master_id = 359 if country_n  == 159 & year == 2011
replace master_id = 360 if country_n  == 159 & year == 2015


replace master_id = 361 if country_n  == 174 & year == 1950 //* UK
replace master_id = 362 if country_n  == 174 & year == 1951
replace master_id = 363 if country_n  == 174 & year == 1955
replace master_id = 364 if country_n  == 174 & year == 1959
replace master_id = 365 if country_n  == 174 & year == 1964
replace master_id = 366 if country_n  == 174 & year == 1966
replace master_id = 367 if country_n  == 174 & year == 1970
replace master_id = 368 if country_n  == 174 & year == 1974
// Two elections in 1974, add second later.
replace master_id = 370 if country_n  == 174 & year == 1979
replace master_id = 371 if country_n  == 174 & year == 1983 
replace master_id = 372 if country_n  == 174 & year == 1987 
replace master_id = 373 if country_n  == 174 & year == 1992
replace master_id = 374 if country_n  == 174 & year == 1997
replace master_id = 375 if country_n  == 174 & year == 2001
replace master_id = 376 if country_n  == 174 & year == 2005
replace master_id = 377 if country_n  == 174 & year == 2010
replace master_id = 378 if country_n  == 174 & year == 2015


replace master_id = 379 if country_n  == 17 & year == 1950 //* Belgium
replace master_id = 380 if country_n  == 17 & year == 1954
replace master_id = 381 if country_n  == 17 & year == 1958
replace master_id = 382 if country_n  == 17 & year == 1961
replace master_id = 383 if country_n  == 17 & year == 1965
replace master_id = 384 if country_n  == 17 & year == 1968
replace master_id = 385 if country_n  == 17 & year == 1971
replace master_id = 386 if country_n  == 17 & year == 1974
replace master_id = 387 if country_n  == 17 & year == 1977
replace master_id = 388 if country_n  == 17 & year == 1978
replace master_id = 389 if country_n  == 17 & year == 1981 
replace master_id = 390 if country_n  == 17 & year == 1985 
replace master_id = 391 if country_n  == 17 & year == 1987
replace master_id = 392 if country_n  == 17 & year == 1991
replace master_id = 393 if country_n  == 17 & year == 1995
replace master_id = 394 if country_n  == 17 & year == 1999
replace master_id = 395 if country_n  == 17 & year == 2003
replace master_id = 396 if country_n  == 17 & year == 2007
replace master_id = 397 if country_n  == 17 & year == 2010
replace master_id = 398 if country_n  == 17 & year == 2014

order master_id, after(year)

drop if master_id ==.

  save "$data1\PennWT_edit.dta", replace

*** Merge Datasets **

use "$data1\Study1Combined.dta"

merge 1:1 master_id using "$data1\PennWT_edit.dta"
label variable master_id "MASTER ID"

save "$data1\Study1Combined.dta", replace

*** Election Year Edits (Data Closer to Election) ***

gen month=month(edate)
order month, after (edate)
label variable month "Election Month"
generate half_year = .
replace half_year = 1 if inrange(month,1,6)
replace half_year = 2 if inrange(month,7,12)
label variable half_year "Which half of the year?"
order half_year, after(month)

*** Where two elections in the same country are in one year, make same apply the same macroeconomic data ***

bysort FEcountry (edate): replace pop =  pop[_n-1]                        if countryelection == 69 | countryelection == 148 | countryelection == 157 | countryelection == 159 | countryelection == 163 | countryelection == 190 | countryelection == 369
bysort FEcountry (edate): replace rgdpna   = rgdpna[_n-1]                 if countryelection == 69 | countryelection == 148 | countryelection == 157 | countryelection == 159 | countryelection == 163 | countryelection == 190 | countryelection == 369
bysort FEcountry (edate): replace PC_rgdpna =  PC_rgdpna[_n-1]            if countryelection == 69 | countryelection == 148 | countryelection == 157 | countryelection == 159 | countryelection == 163 | countryelection == 190 | countryelection == 369
bysort FEcountry (edate): replace lag_rgdpnaPC = lag_rgdpnaPC[_n-1]       if countryelection == 69 | countryelection == 148 | countryelection == 157 | countryelection == 159 | countryelection == 163 | countryelection == 190 | countryelection == 369
bysort FEcountry (edate): replace lag2GR_rgdpnaPC = lag2GR_rgdpnaPC[_n-1] if countryelection == 69 | countryelection == 148 | countryelection == 157 | countryelection == 159 | countryelection == 163 | countryelection == 190 | countryelection == 369
bysort FEcountry (edate): replace openness = openness[_n-1]               if countryelection == 69 | countryelection == 148 | countryelection == 157 | countryelection == 159 | countryelection == 163 | countryelection == 190 | countryelection == 369
bysort FEcountry (edate): replace lag_openness = lag_openness[_n-1]       if countryelection == 69 | countryelection == 148 | countryelection == 157 | countryelection == 159 | countryelection == 163 | countryelection == 190 | countryelection == 369

gen log_lagGDPpc = ln(lag_rgdpnaPC)
label variable log_lagGDPpc "Logged Lagged Per Capita RGDPNA Level(in 10000 2011 US$)"
order log_lagGDPpc, after (lag_rgdpnaPC)

label variable PC_rgdpna "Real GDP per capita (in 10000 2011 US$)"
label variable lag_rgdpnaPC "Lagged Real GDP per capita (in 10000 2011 US$)"
label variable lag2GR_rgdpnaPC "Lagged % Real GDP per capita Growth Rate"
drop countrycode country country_n _merge abs_csh_m abs_csh_x

save "$data1\Study1Combined.dta", replace
clear

********************************************************************* Electoral Systems ************************************************************************

import delimited "$data1\es_data-v3.csv"

replace country = "Germany" if ccode == 260 
encode country, gen(country_n)

order country_n year, after(country)

keep if country_n == 7 | country_n == 8 | country_n == 12 | country_n == 20 | country_n == 32 | country_n == 40 | country_n == 41 | country_n == 43 ///
                       | country_n == 45 | country_n == 52 | country_n == 55 | country_n == 57 | country_n == 69 | country_n == 75 | country_n == 87 ///
					   | country_n == 88 | country_n == 92 | country_n == 101 | country_n == 115 | country_n == 122 | country_n == 124 | country_n == 132

sort country year

destring legislative_type elecrule tier1_formula tier2_formula tier3_formula tier4_formula mixed_type ///
multi multi_linked seats tier1_avemag tier1_districts upperseats uppertier tier2_districts tier3_districts ///
tier4_districts enep enep_others enep1 enpp enpp_others enpp1 enpres preselecrule month day secondround thirdround, replace force

replace uppertier =. if uppertier == -99
replace upperseat =. if upperseat == -99

gen elec_n =.               //* Dummy for years where 2+ elections
replace elec_n = 1 if country_n == 32 & year == 1953 & month == 4 | country_n == 45 & year == 1989 & month == 6  | country_n == 45 & year == 2012 & month == 5  | country_n == 45 & year == 2015 & month == 1  |  country_n == 52 & year == 1959 & month == 6  | country_n == 55 & year == 1982 & month == 2  | country_n == 132 & year == 1974 & month == 2
replace elec_n = 2 if country_n == 32 & year == 1953 & month == 9 | country_n == 45 & year == 1989 & month == 11 | country_n == 45 & year == 2012 & month == 6  | country_n == 45 & year == 2015 & month == 9  |  country_n == 52 & year == 1959 & month == 10 | country_n == 55 & year == 1982 & month == 11 | country_n == 132 & year == 1974 & month == 10

gen master_id =.
order master_id, after(country_n)

drop if presidential == 1 //* Drop presidential elections

replace master_id = -1   if country_n  == 7 & year == 1949 //* AUSTRALIA
replace master_id = 1   if country_n  == 7 & year == 1951
replace master_id = 2   if country_n  == 7 & year == 1954
replace master_id = 3   if country_n  == 7 & year == 1955
replace master_id = 4   if country_n  == 7 & year == 1958
replace master_id = 5   if country_n  == 7 & year == 1961
replace master_id = 6   if country_n  == 7 & year == 1963
replace master_id = 7   if country_n  == 7 & year == 1966
replace master_id = 8  if country_n  == 7 & year == 1969
replace master_id = 9  if country_n  == 7 & year == 1972
replace master_id = 10  if country_n  == 7 & year == 1974
replace master_id = 11  if country_n  == 7 & year == 1975
replace master_id = 12  if country_n  == 7 & year == 1977
replace master_id = 13  if country_n  == 7 & year == 1980
replace master_id = 14  if country_n  == 7 & year == 1983
replace master_id = 15  if country_n  == 7 & year == 1984
replace master_id = 16  if country_n  == 7 & year == 1987
replace master_id = 17  if country_n  == 7 & year == 1990
replace master_id = 18  if country_n  == 7 & year == 1993
replace master_id = 19  if country_n  == 7 & year == 1996
replace master_id = 20  if country_n  == 7 & year == 1998
replace master_id = 21  if country_n  == 7 & year == 2001
replace master_id = 22  if country_n  == 7 & year == 2004
replace master_id = 23  if country_n  == 7 & year == 2007
replace master_id = 24  if country_n  == 7 & year == 2010
replace master_id = 25  if country_n  == 7 & year == 2013
replace master_id = 26  if country_n  == 7 & year == 2016

replace master_id = -2  if country_n  == 8 & year == 1949 //* AUSTRIA
replace master_id = 27  if country_n  == 8 & year == 1953
replace master_id = 28  if country_n  == 8 & year == 1956
replace master_id = 29  if country_n  == 8 & year == 1959
replace master_id = 30  if country_n  == 8 & year == 1962
replace master_id = 31  if country_n  == 8 & year == 1966
replace master_id = 32  if country_n  == 8 & year == 1970
replace master_id = 33  if country_n  == 8 & year == 1971
replace master_id = 34  if country_n  == 8 & year == 1975
replace master_id = 35  if country_n  == 8 & year == 1979
replace master_id = 36  if country_n  == 8 & year == 1983
replace master_id = 37  if country_n  == 8 & year == 1986
replace master_id = 38  if country_n  == 8 & year == 1990
replace master_id = 39  if country_n  == 8 & year == 1994
replace master_id = 40  if country_n  == 8 & year == 1995
replace master_id = 41  if country_n  == 8 & year == 1999
replace master_id = 42  if country_n  == 8 & year == 2002
replace master_id = 43  if country_n  == 8 & year == 2006
replace master_id = 44  if country_n  == 8 & year == 2008
replace master_id = 45  if country_n  == 8 & year == 2013

replace master_id = -3  if country_n  == 20 & year == 1949 //* CANADA
replace master_id = 46  if country_n  == 20 & year == 1953
replace master_id = 47  if country_n  == 20 & year == 1957
replace master_id = 48  if country_n  == 20 & year == 1958
replace master_id = 49  if country_n  == 20 & year == 1962
replace master_id = 50  if country_n  == 20 & year == 1963
replace master_id = 51  if country_n  == 20 & year == 1965
replace master_id = 52  if country_n  == 20 & year == 1968
replace master_id = 53  if country_n  == 20 & year == 1972
replace master_id = 54  if country_n  == 20 & year == 1974
replace master_id = 55  if country_n  == 20 & year == 1979 
replace master_id = 56  if country_n  == 20 & year == 1980 
replace master_id = 57  if country_n  == 20 & year == 1984
replace master_id = 58  if country_n  == 20 & year == 1988
replace master_id = 59  if country_n  == 20 & year == 1993
replace master_id = 60  if country_n  == 20 & year == 1997
replace master_id = 61  if country_n  == 20 & year == 2000
replace master_id = 62  if country_n  == 20 & year == 2004
replace master_id = 63  if country_n  == 20 & year == 2006
replace master_id = 64  if country_n  == 20 & year == 2008
replace master_id = 65  if country_n  == 20 & year == 2011
replace master_id = 66  if country_n  == 20 & year == 2015
														
replace master_id = -4  if country_n  == 32 & year == 1947 //* DENMARK
replace master_id = 67  if country_n  == 32 & year == 1950
replace master_id = 68  if country_n  == 32 & year == 1953 & elec_n == 1
replace master_id = 69  if country_n  == 32 & year == 1953 & elec_n == 2
replace master_id = 70 if country_n  == 32 & year == 1957
replace master_id = 71 if country_n  == 32 & year == 1960
replace master_id = 72 if country_n  == 32 & year == 1964
replace master_id = 73 if country_n  == 32 & year == 1966
replace master_id = 74 if country_n  == 32 & year == 1968
replace master_id = 75 if country_n  == 32 & year == 1971
replace master_id = 76 if country_n  == 32 & year == 1973 
replace master_id = 77 if country_n  == 32 & year == 1975 
replace master_id = 78 if country_n  == 32 & year == 1977
replace master_id = 79 if country_n  == 32 & year == 1979
replace master_id = 80 if country_n  == 32 & year == 1981
replace master_id = 81 if country_n  == 32 & year == 1984
replace master_id = 82 if country_n  == 32 & year == 1987
replace master_id = 83 if country_n  == 32 & year == 1988
replace master_id = 84 if country_n  == 32 & year == 1990
replace master_id = 85 if country_n  == 32 & year == 1994
replace master_id = 86 if country_n  == 32 & year == 1998
replace master_id = 87 if country_n  == 32 & year == 2001						
replace master_id = 88 if country_n  == 32 & year == 2005
replace master_id = 89 if country_n  == 32 & year == 2007
replace master_id = 90 if country_n  == 32 & year == 2011
replace master_id = 91 if country_n  == 32 & year == 2015									
								
replace master_id = -5 if country_n  == 40 & year == 1948 //* FINLAND
replace master_id = 92 if country_n  == 40 & year == 1951
replace master_id = 93 if country_n  == 40 & year == 1954
replace master_id = 94 if country_n  == 40 & year == 1958
replace master_id = 95 if country_n  == 40 & year == 1962
replace master_id = 96 if country_n  == 40 & year == 1966
replace master_id = 97 if country_n  == 40 & year == 1970
replace master_id = 98 if country_n  == 40 & year == 1972
replace master_id = 99 if country_n  == 40 & year == 1975
replace master_id = 100 if country_n  == 40 & year == 1979
replace master_id = 101 if country_n  == 40 & year == 1983 
replace master_id = 102 if country_n  == 40 & year == 1987 
replace master_id = 103 if country_n  == 40 & year == 1991
replace master_id = 104 if country_n  == 40 & year == 1995
replace master_id = 105 if country_n  == 40 & year == 1999
replace master_id = 106 if country_n  == 40 & year == 2003
replace master_id = 107 if country_n  == 40 & year == 2007
replace master_id = 108 if country_n  == 40 & year == 2011
replace master_id = 109 if country_n  == 40 & year == 2015

replace master_id = -6 if country_n  == 41 & year == 1946 //* FRANCE
replace master_id = 110 if country_n  == 41 & year == 1951
replace master_id = 111 if country_n  == 41 & year == 1956
replace master_id = 112 if country_n  == 41 & year == 1958
replace master_id = 113 if country_n  == 41 & year == 1962
replace master_id = 114 if country_n  == 41 & year == 1967
replace master_id = 115 if country_n  == 41 & year == 1968
replace master_id = 116 if country_n  == 41 & year == 1973
replace master_id = 117 if country_n  == 41 & year == 1978
replace master_id = 118 if country_n  == 41 & year == 1981
replace master_id = 119 if country_n  == 41 & year == 1986
replace master_id = 120 if country_n  == 41 & year == 1988 
replace master_id = 121 if country_n  == 41 & year == 1993 
replace master_id = 122 if country_n  == 41 & year == 1997
replace master_id = 123 if country_n  == 41 & year == 2002
replace master_id = 124 if country_n  == 41 & year == 2007
replace master_id = 125 if country_n  == 41 & year == 2012

replace master_id = -7  if country_n  == 43 & year == 1949 //* GERMANY
replace master_id = 126 if country_n  == 43 & year == 1953
replace master_id = 127 if country_n  == 43 & year == 1957
replace master_id = 128 if country_n  == 43 & year == 1961
replace master_id = 129 if country_n  == 43 & year == 1965
replace master_id = 130 if country_n  == 43 & year == 1969
replace master_id = 131 if country_n  == 43 & year == 1972
replace master_id = 132 if country_n  == 43 & year == 1976
replace master_id = 133 if country_n  == 43 & year == 1980
replace master_id = 134 if country_n  == 43 & year == 1983
replace master_id = 135 if country_n  == 43 & year == 1987
replace master_id = 136 if country_n  == 43 & year == 1990 
replace master_id = 137 if country_n  == 43 & year == 1994 
replace master_id = 138 if country_n  == 43 & year == 1998
replace master_id = 139 if country_n  == 43 & year == 2002
replace master_id = 140 if country_n  == 43 & year == 2005
replace master_id = 141 if country_n  == 43 & year == 2009
replace master_id = 142 if country_n  == 43 & year == 2013

replace master_id = -8  if country_n  == 45 & year == 1964 //* GREECE
replace master_id = 143 if country_n  == 45 & year == 1974
replace master_id = 144 if country_n  == 45 & year == 1977
replace master_id = 145 if country_n  == 45 & year == 1981
replace master_id = 146 if country_n  == 45 & year == 1985 
replace master_id = 147 if country_n  == 45 & year == 1989 & elec_n == 1
replace master_id = 148 if country_n  == 45 & year == 1989 & elec_n == 2
replace master_id = 149 if country_n  == 45 & year == 1990
replace master_id = 150 if country_n  == 45 & year == 1993
replace master_id = 151 if country_n  == 45 & year == 1996
replace master_id = 152 if country_n  == 45 & year == 2000
replace master_id = 153 if country_n  == 45 & year == 2004
replace master_id = 154 if country_n  == 45 & year == 2007
replace master_id = 155 if country_n  == 45 & year == 2009
replace master_id = 156 if country_n  == 45 & year == 2012 & elec_n == 1
replace master_id = 157 if country_n  == 45 & year == 2012 & elec_n == 2
replace master_id = 158 if country_n  == 45 & year == 2015 & elec_n == 1
replace master_id = 159 if country_n  == 45 & year == 2015 & elec_n == 2

replace master_id = -9  if country_n  == 52 & year == 1949 //* ICELAND
replace master_id = 160 if country_n  == 52 & year == 1953
replace master_id = 161 if country_n  == 52 & year == 1956
replace master_id = 162 if country_n  == 52 & year == 1959 & elec_n == 1
replace master_id = 163 if country_n  == 52 & year == 1959 & elec_n == 2
replace master_id = 164 if country_n  == 52 & year == 1963
replace master_id = 165 if country_n  == 52 & year == 1967
replace master_id = 166 if country_n  == 52 & year == 1971
replace master_id = 167 if country_n  == 52 & year == 1974
replace master_id = 168 if country_n  == 52 & year == 1978
replace master_id = 169 if country_n  == 52 & year == 1979 
replace master_id = 170 if country_n  == 52 & year == 1983 
replace master_id = 171 if country_n  == 52 & year == 1987
replace master_id = 172 if country_n  == 52 & year == 1991
replace master_id = 173 if country_n  == 52 & year == 1995
replace master_id = 174 if country_n  == 52 & year == 1999
replace master_id = 175 if country_n  == 52 & year == 2003
replace master_id = 176 if country_n  == 52 & year == 2007
replace master_id = 177 if country_n  == 52 & year == 2009
replace master_id = 178 if country_n  == 52 & year == 2013
replace master_id = 179 if country_n  == 52 & year == 2016

replace master_id = -10 if country_n  == 55 & year == 1948  //* IRELAND 
replace master_id = 180 if country_n  == 55 & year == 1951
replace master_id = 181 if country_n  == 55 & year == 1954
replace master_id = 182 if country_n  == 55 & year == 1957
replace master_id = 183 if country_n  == 55 & year == 1961
replace master_id = 184 if country_n  == 55 & year == 1965
replace master_id = 185 if country_n  == 55 & year == 1969
replace master_id = 186 if country_n  == 55 & year == 1973
replace master_id = 187 if country_n  == 55 & year == 1977
replace master_id = 188 if country_n  == 55 & year == 1981
replace master_id = 189 if country_n  == 55 & year == 1982 & elec_n == 1
replace master_id = 190 if country_n  == 55 & year == 1982 & elec_n == 2
replace master_id = 191 if country_n  == 55 & year == 1987 
replace master_id = 192 if country_n  == 55 & year == 1989
replace master_id = 193 if country_n  == 55 & year == 1992
replace master_id = 194 if country_n  == 55 & year == 1997
replace master_id = 195 if country_n  == 55 & year == 2002
replace master_id = 196 if country_n  == 55 & year == 2007
replace master_id = 197 if country_n  == 55 & year == 2011
replace master_id = 198 if country_n  == 55 & year == 2016

replace master_id = -11 if country_n  == 57 & year == 1948 //* Italy
replace master_id = 199 if country_n  == 57 & year == 1953
replace master_id = 200 if country_n  == 57 & year == 1958
replace master_id = 201 if country_n  == 57 & year == 1963
replace master_id = 202 if country_n  == 57 & year == 1968
replace master_id = 203 if country_n  == 57 & year == 1972
replace master_id = 204 if country_n  == 57 & year == 1976
replace master_id = 205 if country_n  == 57 & year == 1979
replace master_id = 206 if country_n  == 57 & year == 1983
replace master_id = 207 if country_n  == 57 & year == 1987
replace master_id = 208 if country_n  == 57 & year == 1992
replace master_id = 209 if country_n  == 57 & year == 1994 
replace master_id = 210 if country_n  == 57 & year == 1996 
replace master_id = 211 if country_n  == 57 & year == 2001
replace master_id = 212 if country_n  == 57 & year == 2006
replace master_id = 213 if country_n  == 57 & year == 2008
replace master_id = 214 if country_n  == 57 & year == 2013

replace master_id = 216 if country_n  == 69 & year == 1954 //* luxembourg
replace master_id = 217 if country_n  == 69 & year == 1959
replace master_id = 218 if country_n  == 69 & year == 1964
replace master_id = 219 if country_n  == 69 & year == 1968
replace master_id = 220 if country_n  == 69 & year == 1974
replace master_id = 221 if country_n  == 69 & year == 1979
replace master_id = 222 if country_n  == 69 & year == 1984
replace master_id = 223 if country_n  == 69 & year == 1989
replace master_id = 224 if country_n  == 69 & year == 1994 
replace master_id = 225 if country_n  == 69 & year == 1999 
replace master_id = 226 if country_n  == 69 & year == 2004
replace master_id = 227 if country_n  == 69 & year == 2009
replace master_id = 228 if country_n  == 69 & year == 2013

replace master_id = 229 if country_n  == 75 & year == 1966 //* Malta
replace master_id = 230 if country_n  == 75 & year == 1971
replace master_id = 231 if country_n  == 75 & year == 1976
replace master_id = 232 if country_n  == 75 & year == 1981
replace master_id = 233 if country_n  == 75 & year == 1987
replace master_id = 234 if country_n  == 75 & year == 1992
replace master_id = 235 if country_n  == 75 & year == 1996
replace master_id = 236 if country_n  == 75 & year == 1998
replace master_id = 237 if country_n  == 75 & year == 2003
replace master_id = 238 if country_n  == 75 & year == 2008

replace master_id = -12 if country_n  == 87 & year == 1948 //* Netherlands
replace master_id = 240 if country_n  == 87 & year == 1952
replace master_id = 241 if country_n  == 87 & year == 1956
replace master_id = 242 if country_n  == 87 & year == 1959
replace master_id = 243 if country_n  == 87 & year == 1963
replace master_id = 244 if country_n  == 87 & year == 1967
replace master_id = 245 if country_n  == 87 & year == 1971
replace master_id = 246 if country_n  == 87 & year == 1972
replace master_id = 247 if country_n  == 87 & year == 1977
replace master_id = 248 if country_n  == 87 & year == 1981
replace master_id = 249 if country_n  == 87 & year == 1982 
replace master_id = 250 if country_n  == 87 & year == 1986 
replace master_id = 251 if country_n  == 87 & year == 1989
replace master_id = 252 if country_n  == 87 & year == 1994
replace master_id = 253 if country_n  == 87 & year == 1998
replace master_id = 254 if country_n  == 87 & year == 2002
replace master_id = 255 if country_n  == 87 & year == 2003
replace master_id = 256 if country_n  == 87 & year == 2006
replace master_id = 257 if country_n  == 87 & year == 2010
replace master_id = 258 if country_n  == 87 & year == 2012

replace master_id = -13 if country_n  == 88 & year == 1949 //* New Zealand
replace master_id = 259 if country_n  == 88 & year == 1951
replace master_id = 260 if country_n  == 88 & year == 1954
replace master_id = 261 if country_n  == 88 & year == 1957
replace master_id = 262 if country_n  == 88 & year == 1960
replace master_id = 263 if country_n  == 88 & year == 1963
replace master_id = 264 if country_n  == 88 & year == 1966
replace master_id = 265 if country_n  == 88 & year == 1969
replace master_id = 266 if country_n  == 88 & year == 1972
replace master_id = 267 if country_n  == 88 & year == 1975
replace master_id = 268 if country_n  == 88 & year == 1978 
replace master_id = 269 if country_n  == 88 & year == 1981 
replace master_id = 270 if country_n  == 88 & year == 1984
replace master_id = 271 if country_n  == 88 & year == 1987
replace master_id = 272 if country_n  == 88 & year == 1990
replace master_id = 273 if country_n  == 88 & year == 1993
replace master_id = 274 if country_n  == 88 & year == 1996
replace master_id = 275 if country_n  == 88 & year == 1999
replace master_id = 276 if country_n  == 88 & year == 2002
replace master_id = 277 if country_n  == 88 & year == 2005
replace master_id = 278 if country_n  == 88 & year == 2008
replace master_id = 279 if country_n  == 88 & year == 2011						
replace master_id = 280 if country_n  == 88 & year == 2014

replace master_id = -14 if country_n  == 92 & year == 1949 //* Norway
replace master_id = 281 if country_n  == 92 & year == 1953
replace master_id = 282 if country_n  == 92 & year == 1957
replace master_id = 283 if country_n  == 92 & year == 1961
replace master_id = 284 if country_n  == 92 & year == 1965
replace master_id = 285 if country_n  == 92 & year == 1969
replace master_id = 286 if country_n  == 92 & year == 1973
replace master_id = 287 if country_n  == 92 & year == 1977
replace master_id = 288 if country_n  == 92 & year == 1981
replace master_id = 289 if country_n  == 92 & year == 1985
replace master_id = 290 if country_n  == 92 & year == 1989 
replace master_id = 291 if country_n  == 92 & year == 1993 
replace master_id = 292 if country_n  == 92 & year == 1997
replace master_id = 293 if country_n  == 92 & year == 2001
replace master_id = 294 if country_n  == 92 & year == 2005
replace master_id = 295 if country_n  == 92 & year == 2009
replace master_id = 296 if country_n  == 92 & year == 2013

replace master_id = 297 if country_n  == 101 & year == 1976 //* Portugal
replace master_id = 298 if country_n  == 101 & year == 1979
replace master_id = 299 if country_n  == 101 & year == 1980
replace master_id = 300 if country_n  == 101 & year == 1983
replace master_id = 301 if country_n  == 101 & year == 1985
replace master_id = 302 if country_n  == 101 & year == 1987
replace master_id = 303 if country_n  == 101 & year == 1991
replace master_id = 304 if country_n  == 101 & year == 1995
replace master_id = 305 if country_n  == 101 & year == 1999
replace master_id = 306 if country_n  == 101 & year == 2002
replace master_id = 307 if country_n  == 101 & year == 2005
replace master_id = 308 if country_n  == 101 & year == 2009 
replace master_id = 309 if country_n  == 101 & year == 2011 
replace master_id = 310 if country_n  == 101 & year == 2015

replace master_id = 311 if country_n  == 115 & year == 1977 //* Spain
replace master_id = 312 if country_n  == 115 & year == 1979
replace master_id = 313 if country_n  == 115 & year == 1982
replace master_id = 314 if country_n  == 115 & year == 1986
replace master_id = 315 if country_n  == 115 & year == 1989
replace master_id = 316 if country_n  == 115 & year == 1993
replace master_id = 317 if country_n  == 115 & year == 1996
replace master_id = 318 if country_n  == 115 & year == 2000
replace master_id = 319 if country_n  == 115 & year == 2004
replace master_id = 320 if country_n  == 115 & year == 2008
replace master_id = 321 if country_n  == 115 & year == 2011
replace master_id = 322 if country_n  == 115 & year == 2015
replace master_id = 323 if country_n  == 115 & year == 2016 

replace master_id = -15 if country_n  == 122 & year == 1948 //* Sweden
replace master_id = 324 if country_n  == 122 & year == 1952
replace master_id = 325 if country_n  == 122 & year == 1956
replace master_id = 326 if country_n  == 122 & year == 1958
replace master_id = 327 if country_n  == 122 & year == 1960
replace master_id = 328 if country_n  == 122 & year == 1964
replace master_id = 329 if country_n  == 122 & year == 1968
replace master_id = 330 if country_n  == 122 & year == 1970
replace master_id = 331 if country_n  == 122 & year == 1973
replace master_id = 332 if country_n  == 122 & year == 1976
replace master_id = 333 if country_n  == 122 & year == 1979
replace master_id = 334 if country_n  == 122 & year == 1982 
replace master_id = 335 if country_n  == 122 & year == 1985 
replace master_id = 336 if country_n  == 122 & year == 1988
replace master_id = 337 if country_n  == 122 & year == 1991
replace master_id = 338 if country_n  == 122 & year == 1994
replace master_id = 339 if country_n  == 122 & year == 1998
replace master_id = 340 if country_n  == 122 & year == 2002
replace master_id = 341 if country_n  == 122 & year == 2006
replace master_id = 342 if country_n  == 122 & year == 2010
replace master_id = 343 if country_n  == 122 & year == 2014

replace master_id = -16 if country_n  == 124 & year == 1947 //* Switzerland
replace master_id = 344 if country_n  == 124 & year == 1951
replace master_id = 345 if country_n  == 124 & year == 1955
replace master_id = 346 if country_n  == 124 & year == 1959
replace master_id = 347 if country_n  == 124 & year == 1963
replace master_id = 348 if country_n  == 124 & year == 1967
replace master_id = 349 if country_n  == 124 & year == 1971
replace master_id = 350 if country_n  == 124 & year == 1975
replace master_id = 351 if country_n  == 124 & year == 1979
replace master_id = 352 if country_n  == 124 & year == 1983
replace master_id = 353 if country_n  == 124 & year == 1987
replace master_id = 354 if country_n  == 124 & year == 1991 
replace master_id = 355 if country_n  == 124 & year == 1995 
replace master_id = 356 if country_n  == 124 & year == 1999
replace master_id = 357 if country_n  == 124 & year == 2003
replace master_id = 358 if country_n  == 124 & year == 2007
replace master_id = 359 if country_n  == 124 & year == 2011
replace master_id = 360 if country_n  == 124 & year == 2015

replace master_id = -17 if country_n  == 132 & year == 1945 //* United Kingdom
replace master_id = 361 if country_n  == 132 & year == 1950
replace master_id = 362 if country_n  == 132 & year == 1951
replace master_id = 363 if country_n  == 132 & year == 1955
replace master_id = 364 if country_n  == 132 & year == 1959
replace master_id = 365 if country_n  == 132 & year == 1964
replace master_id = 366 if country_n  == 132 & year == 1966
replace master_id = 367 if country_n  == 132 & year == 1970
replace master_id = 368 if country_n  == 132 & year == 1974 & elec_n == 1
replace master_id = 369 if country_n  == 132 & year == 1974 & elec_n == 2
replace master_id = 370 if country_n  == 132 & year == 1979 
replace master_id = 371 if country_n  == 132 & year == 1983 
replace master_id = 372 if country_n  == 132 & year == 1987 
replace master_id = 373 if country_n  == 132 & year == 1992
replace master_id = 374 if country_n  == 132 & year == 1997
replace master_id = 375 if country_n  == 132 & year == 2001
replace master_id = 376 if country_n  == 132 & year == 2005
replace master_id = 377 if country_n  == 132 & year == 2010
replace master_id = 378 if country_n  == 132 & year == 2015

replace master_id = -18 if country_n  == 12 & year == 1949 //* Belgium
replace master_id = 379 if country_n  == 12 & year == 1950
replace master_id = 380 if country_n  == 12 & year == 1954
replace master_id = 381 if country_n  == 12 & year == 1958
replace master_id = 382 if country_n  == 12 & year == 1961
replace master_id = 383 if country_n  == 12 & year == 1965
replace master_id = 384 if country_n  == 12 & year == 1968
replace master_id = 385 if country_n  == 12 & year == 1971
replace master_id = 386 if country_n  == 12 & year == 1974
replace master_id = 387 if country_n  == 12 & year == 1977
replace master_id = 388 if country_n  == 12 & year == 1978
replace master_id = 389 if country_n  == 12 & year == 1981 
replace master_id = 390 if country_n  == 12 & year == 1985 
replace master_id = 391 if country_n  == 12 & year == 1987
replace master_id = 392 if country_n  == 12 & year == 1991
replace master_id = 393 if country_n  == 12 & year == 1995
replace master_id = 394 if country_n  == 12 & year == 1999
replace master_id = 395 if country_n  == 12 & year == 2003
replace master_id = 396 if country_n  == 12 & year == 2007
replace master_id = 397 if country_n  == 12 & year == 2010
replace master_id = 398 if country_n  == 12 & year == 2014

drop if master_id ==.

* Identify 'Decisive Electoral Tiers' (Carter 2002: 129 - 131; Lijphart 1994: 30 -39)

generate uptier_decisive = .

replace uptier_decisive = 1 if country_n == 43 | country_n == 57 & year > 1993 & year < 2002 | country_n == 92 & year > 1988 | country_n == 32 | country_n == 122 & year > 1969 | country_n == 88 & year > 1995

* Replace Tier Info nearest available if missing *

sort country_n master_id
bysort country_n (master_id): replace tier2_districts = (tier2_districts[_n-1] + tier2_districts[_n+1])/2 if tier2_districts ==.
bysort country_n (master_id): replace tier2_districts = (tier2_districts[_n-2] + tier2_districts[_n+1])/2 if tier2_districts ==.
bysort country_n (master_id): replace tier2_districts = (tier2_districts[_n-1] + tier2_districts[_n+2])/2 if tier2_districts ==.
bysort country_n (master_id): replace tier2_districts = (tier2_districts[_n-2] + tier2_districts[_n+2])/2 if tier2_districts ==.
bysort country_n (master_id): replace tier2_districts = (tier2_districts[_n-3] + tier2_districts[_n+2])/2 if tier2_districts ==.
bysort country_n (master_id): replace tier2_districts = (tier2_districts[_n-2] + tier2_districts[_n+3])/2 if tier2_districts ==.
bysort country_n (master_id): replace tier2_districts = (tier2_districts[_n-3] + tier2_districts[_n+3])/2 if tier2_districts ==.
bysort country_n (master_id): replace tier2_districts = tier2_districts[_n+1] if tier2_districts ==.
bysort country_n (master_id): replace tier2_districts = tier2_districts[_n-1] if tier2_districts ==.
bysort country_n (master_id): replace tier2_districts = (tier2_districts[_n-1] + tier2_districts[_n+1])/2 if tier2_districts <0

bysort country_n (master_id): replace upperseats = (upperseats[_n-1] + upperseats[_n+1])/2 if upperseats ==.
bysort country_n (master_id): replace upperseats = (upperseats[_n-2] + upperseats[_n+1])/2 if upperseats ==.
bysort country_n (master_id): replace upperseats = (upperseats[_n-1] + upperseats[_n+2])/2 if upperseats ==.
bysort country_n (master_id): replace upperseats = (upperseats[_n-2] + upperseats[_n+2])/2 if upperseats ==.
bysort country_n (master_id): replace upperseats = (upperseats[_n-3] + upperseats[_n+2])/2 if upperseats ==.
bysort country_n (master_id): replace upperseats = (upperseats[_n-2] + upperseats[_n+3])/2 if upperseats ==.
bysort country_n (master_id): replace upperseats = (upperseats[_n-3] + upperseats[_n+3])/2 if upperseats ==.
bysort country_n (master_id): replace upperseats = upperseats[_n+1] if upperseats ==.
bysort country_n (master_id): replace upperseats = upperseats[_n-1] if upperseats ==.
bysort country_n (master_id): replace upperseats = (upperseats[_n-1] + upperseats[_n+1])/2 if upperseats <0

bysort country_n (master_id): replace tier1_avemag = (tier1_avemag[_n-1] + tier1_avemag[_n+1])/2 if tier1_avemag ==.
bysort country_n (master_id): replace tier1_avemag = (tier1_avemag[_n-2] + tier1_avemag[_n+1])/2 if tier1_avemag ==.
bysort country_n (master_id): replace tier1_avemag = (tier1_avemag[_n-1] + tier1_avemag[_n+2])/2 if tier1_avemag ==.
bysort country_n (master_id): replace tier1_avemag = (tier1_avemag[_n-2] + tier1_avemag[_n+2])/2 if tier1_avemag ==.
bysort country_n (master_id): replace tier1_avemag = (tier1_avemag[_n-3] + tier1_avemag[_n+2])/2 if tier1_avemag ==.
bysort country_n (master_id): replace tier1_avemag = (tier1_avemag[_n-2] + tier1_avemag[_n+3])/2 if tier1_avemag ==.
bysort country_n (master_id): replace tier1_avemag = (tier1_avemag[_n-3] + tier1_avemag[_n+3])/2 if tier1_avemag ==.
bysort country_n (master_id): replace tier1_avemag = tier1_avemag[_n+1] if tier1_avemag ==.
bysort country_n (master_id): replace tier1_avemag = tier1_avemag[_n-1] if tier1_avemag ==.
bysort country_n (master_id): replace tier1_avemag = (tier1_avemag[_n-1] + tier1_avemag[_n+1])/2 if tier1_avemag <0

generate tier2_avemag = upperseats / tier2_districts


generate decisive = .
replace decisive = tier1_avemag if uptier_d ==. 
replace decisive = tier2_avemag if uptier_d == 1

order country_n year decisive tier1_avemag uptier_d upperseats tier2_dis tier2_avemag, after(country)

generate effective_thresh = 75/(decisive+1)

order effective_thr, after(decisive)

generate legal_thresh = .   //* Data taken from Reading University's Electoral Change in Europe since 1945 reports.
order legal_thresh, after (effective)
replace legal_thresh = 4 if country_n == 8 & year >= 1992
replace legal_thresh = 5 if country_n == 12 & year >= 2003
replace legal_thresh = 2.5 if country_n == 32 & year >= 1953
replace legal_thresh = 2 if country_n == 32 & year >= 1961
replace legal_thresh = 5 if country_n == 41 & year == 1986
replace legal_thresh = 5 if country_n == 43 & year >= 1954
replace legal_thresh = 3 if country_n == 45 & year > 1990
replace legal_thresh = 5 if country_n == 52 & year >= 2000
replace legal_thresh = 4 if country_n == 57 & year >= 1993
replace legal_thresh = 3 if country_n == 57 & year >= 2005
replace legal_thresh = 1 if country_n == 87 & year < 1956
replace legal_thresh = 0.67 if country_n == 87 & year >= 1956
replace legal_thresh = 5 if country_n == 88 & year >= 1996
replace legal_thresh = 4 if country_n == 92 & year >= 1989
replace legal_thresh = 3 if country_n == 115
replace legal_thresh = 4 if country_n == 122 & year >= 1969

generate threshold = .
replace threshold = legal_thresh if legal_thresh > effective_thresh
replace threshold = effective_thresh if threshold ==.
order threshold, after(legal_thresh)

gen lagged_tier1 =.
gen lagged_tier2 =.
gen lagged_decisive =.
gen lagged_legalthresh =.
gen lagged_effecthresh =.
gen lagged_thresh =.

bysort country_n (master_id): replace lagged_tier1 = tier1_avemag[_n-1]
bysort country_n (master_id): replace lagged_tier2 = tier2_avemag[_n-1]
bysort country_n (master_id): replace lagged_decisive = decisive[_n-1]
bysort country_n (master_id): replace lagged_legalthresh = legal_thresh[_n-1]
bysort country_n (master_id): replace lagged_effecthresh = effective_thresh[_n-1]
bysort country_n (master_id): replace lagged_thresh = threshold[_n-1]

drop presidential legislative_type elecrule tier1_formula tier2_formula tier3_formula ///
tier4_formula mixed_type multi multi_linked seats tier1_districts uppertier tier3_districts ///
tier4_districts enep_others enep1 enpp_others enpp1 enpres preselecrule region1 ///
region2 region3 aclp_code ccode ccode2 month day regime secondround thirdround

order elec_id country country_n year tier1_avemag lagged_tier1 tier2_avemag lagged_tier2 ///
decisive lagged_decisive effective_thresh lagged_effecthresh legal_thresh lagged_legalthresh threshold lagged_thresh enep enpp


save "$data1\Elecsys.dta", replace

clear

use "$data1\Study1Combined.dta"
merge 1:1 master_id using "$data1\Elecsys.dta"
drop _merge

//* Where data is missing use next nearest available (<15 elections).

bysort FEcountry (master_id): replace tier1_avemag = tier1_avemag[_n-1] if tier1_avemag ==.
bysort FEcountry (master_id): replace lagged_tier1 = lagged_tier1[_n-1] if lagged_tier1 ==.
bysort FEcountry (master_id): replace tier2_avemag = tier2_avemag[_n-1] if tier2_avemag ==.
bysort FEcountry (master_id): replace lagged_tier2 = lagged_tier2[_n-1] if lagged_tier2 ==.
bysort FEcountry (master_id): replace decisive = decisive[_n-1] if decisive ==.
bysort FEcountry (master_id): replace lagged_decisive = lagged_decisive[_n-1] if lagged_decisive ==.
bysort FEcountry (master_id): replace effective_thresh = effective_thresh[_n-1] if effective_thresh ==.
bysort FEcountry (master_id): replace lagged_effecthresh = lagged_effecthresh[_n-1] if lagged_effecthresh ==.
bysort FEcountry (master_id): replace legal_thresh = legal_thresh[_n-1] if legal_thresh ==.
bysort FEcountry (master_id): replace lagged_legalthresh = lagged_legalthresh[_n-1] if lagged_legalthresh ==.
bysort FEcountry (master_id): replace lagged_thresh = lagged_thresh[_n-1] if lagged_thresh ==.
bysort FEcountry (master_id): replace threshold = threshold[_n-1] if threshold ==.
bysort FEcountry (master_id): replace uptier_decisive = uptier_decisive[_n-1] if uptier_decisive ==.
bysort FEcountry (master_id): replace upperseats = upperseats[_n-1] if upperseats ==.
bysort FEcountry (master_id): replace tier2_districts = tier2_districts[_n-1] if tier2_districts ==.
bysort FEcountry (master_id): replace enep = enep[_n-1] if enep ==.
bysort FEcountry (master_id): replace enpp = enpp[_n-1] if enpp ==.

bysort FEcountry (master_id): replace tier1_avemag = tier1_avemag[_n+1] if tier1_avemag ==.
bysort FEcountry (master_id): replace lagged_tier1 = lagged_tier1[_n+1] if lagged_tier1 ==.
bysort FEcountry (master_id): replace tier2_avemag = tier2_avemag[_n+1] if tier2_avemag ==.
bysort FEcountry (master_id): replace lagged_tier2 = lagged_tier2[_n+1] if lagged_tier2 ==.
bysort FEcountry (master_id): replace decisive = decisive[_n+1] if decisive ==.
bysort FEcountry (master_id): replace lagged_decisive = lagged_decisive[_n+1] if lagged_decisive ==.
bysort FEcountry (master_id): replace effective_thresh = effective_thresh[_n+1] if effective_thresh ==.
bysort FEcountry (master_id): replace lagged_effecthresh = lagged_effecthresh[_n+1] if lagged_effecthresh ==.
bysort FEcountry (master_id): replace legal_thresh = legal_thresh[_n+1] if legal_thresh ==.
bysort FEcountry (master_id): replace lagged_legalthresh = lagged_legalthresh[_n+1] if lagged_legalthresh ==.
bysort FEcountry (master_id): replace lagged_thresh = lagged_thresh[_n+1] if lagged_thresh ==.
bysort FEcountry (master_id): replace threshold = threshold[_n+1] if threshold ==.
bysort FEcountry (master_id): replace uptier_decisive = uptier_decisive[_n+1] if uptier_decisive ==.
bysort FEcountry (master_id): replace upperseats = upperseats[_n+1] if upperseats ==.
bysort FEcountry (master_id): replace tier2_districts = tier2_districts[_n+1] if tier2_districts ==.
bysort FEcountry (master_id): replace enep = enep[_n+1] if enep ==.
bysort FEcountry (master_id): replace enpp = enpp[_n+1] if enpp ==.

bysort FEcountry (master_id): replace tier1_avemag = tier1_avemag[_n+1] if tier1_avemag ==.
bysort FEcountry (master_id): replace lagged_tier1 = lagged_tier1[_n+1] if lagged_tier1 ==.
bysort FEcountry (master_id): replace tier2_avemag = tier2_avemag[_n+1] if tier2_avemag ==.
bysort FEcountry (master_id): replace lagged_tier2 = lagged_tier2[_n+1] if lagged_tier2 ==.
bysort FEcountry (master_id): replace decisive = decisive[_n+1] if decisive ==.
bysort FEcountry (master_id): replace lagged_decisive = lagged_decisive[_n+1] if lagged_decisive ==.
bysort FEcountry (master_id): replace effective_thresh = effective_thresh[_n+1] if effective_thresh ==.
bysort FEcountry (master_id): replace lagged_effecthresh = lagged_effecthresh[_n+1] if lagged_effecthresh ==.
bysort FEcountry (master_id): replace legal_thresh = legal_thresh[_n+1] if legal_thresh ==.
bysort FEcountry (master_id): replace lagged_legalthresh = lagged_legalthresh[_n+1] if lagged_legalthresh ==.
bysort FEcountry (master_id): replace lagged_thresh = lagged_thresh[_n+1] if lagged_thresh ==.
bysort FEcountry (master_id): replace threshold = threshold[_n+1] if threshold ==.
bysort FEcountry (master_id): replace uptier_decisive = uptier_decisive[_n+1] if uptier_decisive ==.
bysort FEcountry (master_id): replace upperseats = upperseats[_n+1] if upperseats ==.
bysort FEcountry (master_id): replace tier2_districts = tier2_districts[_n+1] if tier2_districts ==.   
bysort FEcountry (master_id): replace enep = enep[_n+1] if enep ==.
bysort FEcountry (master_id): replace enpp = enpp[_n+1] if enpp ==.

label variable tier1_avemag "Tier 1 District Magnitude"
label variable tier2_avemag "Tier 2 District Magnitude"
label variable decisive "Decisive Magnitude District Magnitude"
label variable effective_thresh "Effective Threshold"
label variable legal_thresh "Legal Threshold"
label variable threshold "Electoral Threshold (Effective or Legal if the latter is higher)"
label variable enep "Effective Number of Electoral Parties (Laakso and Taagepera 1979 - via Bormann and Golder 2016)"
label variable enpp "Effective Number of Parliamentary Parties (Laakso and Taagepera 1979 - via Bormann and Golder 2016)"

bysort FEcountry (master_id): gen lag_enep = enep[_n-1]
bysort FEcountry (master_id): gen lag_enpp = enpp[_n-1]

label variable lag_enep "Lagged Effective Number of Electoral Parties (Laakso and Taagepera 1979 - via Bormann and Golder 2016)"
label variable lag_enpp "Lagged Effective Number of Parliamentary Parties (Laakso and Taagepera 1979 - via Bormann and Golder 2016)"


//* Fill in Missing Lag_ENEP / Lag_ENPP Data using Gallagher's Online Indices where not in B/G 2016

* Australia 1951
replace lag_enep = 2.64  if countryelection == 1
replace lag_enpp = 2.62  if countryelection == 1

* Austria 1953
replace lag_enep = 2.78  if countryelection == 27
replace lag_enpp = 2.54  if countryelection == 27

* Canada 1953
replace lag_enep = 2.83  if countryelection == 46
replace lag_enpp = 1.75  if countryelection == 46

* Denmark 1950
replace lag_enep = 3.80  if countryelection == 67
replace lag_enpp = 3.56  if countryelection == 67

* Finland 1951
replace lag_enep = 4.89  if countryelection == 92
replace lag_enpp = 4.54  if countryelection == 92

* France 1951
replace lag_enep = 4.65  if countryelection == 110
replace lag_enpp = 4.32  if countryelection == 110

* Germany 1953
replace lag_enep = 5.70  if countryelection == 126
replace lag_enpp = 4.65  if countryelection == 126

* Greece 1974
replace lag_enep = 2.40  if countryelection == 143
replace lag_enpp = 2.19  if countryelection == 143

* Iceland 1953
replace lag_enep = 3.55  if countryelection == 160
replace lag_enpp = 3.47  if countryelection == 160

* Ireland 1951
replace lag_enep = 4.10  if countryelection == 180
replace lag_enpp = 3.66  if countryelection == 180

* Italy 1953
replace lag_enep = 2.95  if countryelection == 199
replace lag_enpp = 2.57  if countryelection == 199

* Luxembourg 1951
replace lag_enep = 3.16  if countryelection == 215
replace lag_enpp = 3.07  if countryelection == 215

* Malta 1966
replace lag_enep = 3.22  if countryelection == 229
replace lag_enpp = 2.74  if countryelection == 229

* Netherlands 1952
replace lag_enep = 5.00  if countryelection == 240
replace lag_enpp = 4.65  if countryelection == 240

* New Zealand 1951
replace lag_enep = 2.03  if countryelection == 259
replace lag_enpp = 1.96  if countryelection == 259

* Norway 1953
replace lag_enep = 3.62  if countryelection == 281
replace lag_enpp = 2.67  if countryelection == 281

* Portugal 1976
replace lag_enep = 3.66  if countryelection == 297
replace lag_enpp = 2.93  if countryelection == 297

* Spain 1977
replace lag_enep = 4.30  if countryelection == 311
replace lag_enpp = 2.91  if countryelection == 311

* Sweden 1952
replace lag_enep = 3.34  if countryelection == 324
replace lag_enpp = 3.06  if countryelection == 324

* Switzerland 1951
replace lag_enep = 5.34  if countryelection == 344
replace lag_enpp = 5.00  if countryelection == 344

* United Kingdom 1950
replace lag_enep = 2.72  if countryelection == 361
replace lag_enpp = 2.12  if countryelection == 361


* Flanders (All) - Calculated using the calcualtor on Michael Gallagher's Website using the election returns data above. ENPP is for Belgium as a whole

* 1950
replace enep = 2.46      if countryelection == 379
replace enpp = 2.49      if countryelection == 379
replace lag_enep = 2.46  if countryelection == 379
replace lag_enpp = 2.75   if countryelection == 379

* 1954
replace enep = 2.89      if countryelection == 380
replace enpp = 2.63       if countryelection == 380 
replace lag_enep = 2.46  if countryelection == 380 
replace lag_enpp = 2.49   if countryelection == 380 

* 1958
replace enep = 2.64      if countryelection == 381 
replace enpp = 2.45      if countryelection == 381 
replace lag_enep = 2.89  if countryelection == 381 
replace lag_enpp = 2.63  if countryelection == 381 

* 1961
replace enep = 2.98      if countryelection == 382 
replace enpp = 2.69      if countryelection == 382 
replace lag_enep = 2.64  if countryelection == 382 
replace lag_enpp = 2.45  if countryelection == 382 

* 1965
replace enep = 3.78      if countryelection == 383 
replace enpp = 3.59      if countryelection == 383 
replace lag_enep = 2.98  if countryelection == 383 
replace lag_enpp = 2.69  if countryelection == 383 

* 1968
replace enep = 4.01      if countryelection == 384 
replace enpp = 4.97      if countryelection == 384 
replace lag_enep = 3.78  if countryelection == 384 
replace lag_enpp = 3.59  if countryelection == 384 

* 1971
replace enep = 4.59      if countryelection == 385 
replace enpp = 5.45      if countryelection == 385  
replace lag_enep = 4.01  if countryelection == 385  
replace lag_enpp = 4.97  if countryelection == 385  

* 1974
replace enep = 4.48      if countryelection == 386 
replace enpp = 5.76      if countryelection == 386  
replace lag_enep = 4.59  if countryelection == 386  
replace lag_enpp = 5.45  if countryelection == 386  

* 1977
replace enep = 3.92      if countryelection == 387  
replace enpp = 5.24      if countryelection == 387 
replace lag_enep = 4.48  if countryelection == 387 
replace lag_enpp = 5.76  if countryelection == 387 

* 1978
replace enep = 4.17      if countryelection == 388 
replace enpp = 6.80      if countryelection == 388  
replace lag_enep = 3.92  if countryelection == 388  
replace lag_enpp = 5.24  if countryelection == 388 

* 1981
replace enep = 5.04      if countryelection == 389 
replace enpp = 7.62      if countryelection == 389  
replace lag_enep = 4.17  if countryelection == 389  
replace lag_enpp = 6.80  if countryelection == 389  

* 1985
replace enep = 4.60      if countryelection == 390  
replace enpp = 7.00      if countryelection == 390  
replace lag_enep = 5.04  if countryelection == 390  
replace lag_enpp = 7.62  if countryelection == 390  

* 1987
replace enep = 4.64      if countryelection == 391  
replace enpp = 7.13      if countryelection == 391   
replace lag_enep = 4.60  if countryelection == 391   
replace lag_enpp = 7.00  if countryelection == 391   

* 1991
replace enep =  5.66     if countryelection == 392   
replace enpp =  8.41     if countryelection == 392   
replace lag_enep = 4.64  if countryelection == 392   
replace lag_enpp = 7.13  if countryelection == 392   

* 1995
replace enep = 5.31      if countryelection == 393   
replace enpp = 8.03      if countryelection == 393   
replace lag_enep = 5.66  if countryelection == 393  
replace lag_enpp = 8.41  if countryelection == 393  

* 1999
replace enep = 5.78      if countryelection == 394  
replace enpp = 9.05      if countryelection == 394  
replace lag_enep = 5.31  if countryelection == 394  
replace lag_enpp = 8.03  if countryelection == 394  

* 2003
replace enep = 4.95      if countryelection == 395  
replace enpp = 7.03      if countryelection == 395   
replace lag_enep = 5.78  if countryelection == 395   
replace lag_enpp = 9.05  if countryelection == 395   

* 2007
replace enep = 5.00      if countryelection == 396   
replace enpp = 7.91      if countryelection == 396  
replace lag_enep = 4.95  if countryelection == 396  
replace lag_enpp = 7.03  if countryelection == 396  

* 2010
replace enep = 5.75      if countryelection == 397  
replace enpp = 8.42      if countryelection == 397  
replace lag_enep = 5.00  if countryelection == 397  
replace lag_enpp = 7.91  if countryelection == 397  

* 2014
replace enep = 5.10      if countryelection == 398 
replace enpp = 7.82      if countryelection == 398  
replace lag_enep = 5.75  if countryelection == 398  
replace lag_enpp = 8.42  if countryelection == 398  

* Wallonia (All)

* 1950
replace enep = 2.96      if countryelection == 399
replace enpp = 2.49       if countryelection == 399 
replace lag_enep = 2.96  if countryelection == 399 
replace lag_enpp = 2.75   if countryelection == 399 

* 1954
replace enep = 2.72      if countryelection == 400 
replace enpp = 2.63      if countryelection == 400  
replace lag_enep = 2.96  if countryelection == 400  
replace lag_enpp = 2.49  if countryelection == 400  

* 1958
replace enep = 2.86      if countryelection == 401  
replace enpp = 2.45      if countryelection == 401 
replace lag_enep = 2.72  if countryelection == 401 
replace lag_enpp = 2.63  if countryelection == 401 

* 1961
replace enep = 3.02      if countryelection == 402
replace enpp = 2.69      if countryelection == 402 
replace lag_enep = 2.86  if countryelection == 402 
replace lag_enpp = 2.45  if countryelection == 402 

* 1965
replace enep = 3.81      if countryelection == 403 
replace enpp = 3.59      if countryelection == 403 
replace lag_enep = 3.02  if countryelection == 403 
replace lag_enpp = 2.69  if countryelection == 403 

* 1968
replace enep = 3.97      if countryelection == 404 
replace enpp = 4.97      if countryelection == 404  
replace lag_enep = 3.81  if countryelection == 404  
replace lag_enpp = 3.59  if countryelection == 404  

* 1971
replace enep = 4.17      if countryelection == 405  
replace enpp = 5.45      if countryelection == 405 
replace lag_enep = 3.97  if countryelection == 405 
replace lag_enpp = 4.97  if countryelection == 405 

* 1974
replace enep = 4.06      if countryelection == 406 
replace enpp = 5.76      if countryelection == 406 
replace lag_enep = 4.17  if countryelection == 406 
replace lag_enpp = 5.45  if countryelection == 406 

* 1977
replace enep = 3.64      if countryelection == 407 
replace enpp = 5.24      if countryelection == 407 
replace lag_enep = 4.06  if countryelection == 407 
replace lag_enpp = 5.76  if countryelection == 407 

* 1978
replace enep = 3.90      if countryelection == 408
replace enpp = 6.80      if countryelection == 408 
replace lag_enep = 3.64  if countryelection == 408 
replace lag_enpp = 5.24  if countryelection == 408 

* 1981
replace enep = 4.28      if countryelection == 409
replace enpp = 7.62      if countryelection == 409 
replace lag_enep = 3.90  if countryelection == 409 
replace lag_enpp = 6.80  if countryelection == 409 

* 1985
replace enep = 3.58      if countryelection == 410 
replace enpp = 7.00      if countryelection == 410  
replace lag_enep = 4.28  if countryelection == 410  
replace lag_enpp = 7.62  if countryelection == 410  

* 1987
replace enep = 3.59      if countryelection == 411  
replace enpp = 7.13      if countryelection == 411 
replace lag_enep = 3.58  if countryelection == 411 
replace lag_enpp = 7.00  if countryelection == 411 

* 1991
replace enep = 3.78      if countryelection == 412 
replace enpp = 8.41      if countryelection == 412 
replace lag_enep = 3.59  if countryelection == 412 
replace lag_enpp = 7.13  if countryelection == 412 

* 1995
replace enep = 4.23      if countryelection == 413 
replace enpp = 8.03      if countryelection == 413 
replace lag_enep = 3.78  if countryelection == 413 
replace lag_enpp = 8.41  if countryelection == 413 

* 1999
replace enep = 4.66      if countryelection == 414 
replace enpp = 9.05      if countryelection == 414  
replace lag_enep = 4.23  if countryelection == 414  
replace lag_enpp = 8.03  if countryelection == 414  

* 2003
replace enep = 4.00      if countryelection == 415  
replace enpp = 7.03      if countryelection == 415  
replace lag_enep = 4.66  if countryelection == 415  
replace lag_enpp = 9.05  if countryelection == 415  

* 2007
replace enep = 4.30      if countryelection == 416  
replace enpp = 7.91      if countryelection == 416 
replace lag_enep = 4.00  if countryelection == 416
replace lag_enpp = 7.03  if countryelection == 416 

* 2010
replace enep = 4.16      if countryelection == 417 
replace enpp = 8.42      if countryelection == 417  
replace lag_enep = 4.30  if countryelection == 417  
replace lag_enpp = 7.91  if countryelection == 417  

* 2014
replace enep = 4.56      if countryelection == 418  
replace enpp = 7.82      if countryelection == 418  
replace lag_enep = 4.16  if countryelection == 418  
replace lag_enpp = 8.42  if countryelection == 418  

drop if master_id < 0

save "$data1\Study1Combined.dta", replace
clear


***** Federalism.

import excel "$data1\RAI country data online version.11.01.15.xlsx", firstrow


encode country_name, gen(country_n)
order country_n, after (country_name)
keep country_ID country_name country_n year n_RAI

gen master_id =.

replace master_id = -1   if country_n  == 3 & year == 1950
replace master_id = 1   if country_n  == 3 & year == 1951
replace master_id = 2   if country_n  == 3 & year == 1954
replace master_id = 3   if country_n  == 3 & year == 1955
replace master_id = 4   if country_n  == 3 & year == 1958
replace master_id = 5   if country_n  == 3 & year == 1961
replace master_id = 6   if country_n  == 3 & year == 1963
replace master_id = 7   if country_n  == 3 & year == 1966
replace master_id = 8  if country_n  == 3 & year == 1969
replace master_id = 9  if country_n  == 3 & year == 1972
replace master_id = 10  if country_n  == 3 & year == 1974
replace master_id = 11  if country_n  == 3 & year == 1975
replace master_id = 12  if country_n  == 3 & year == 1977
replace master_id = 13  if country_n  == 3 & year == 1980
replace master_id = 14  if country_n  == 3 & year == 1983
replace master_id = 15  if country_n  == 3 & year == 1984
replace master_id = 16  if country_n  == 3 & year == 1987
replace master_id = 17  if country_n  == 3 & year == 1990
replace master_id = 18  if country_n  == 3 & year == 1993
replace master_id = 19  if country_n  == 3 & year == 1996
replace master_id = 20  if country_n  == 3 & year == 1998
replace master_id = 21  if country_n  == 3 & year == 2001
replace master_id = 22  if country_n  == 3 & year == 2004
replace master_id = 23  if country_n  == 3 & year == 2007
replace master_id = 24  if country_n  == 3 & year == 2010
replace master_id = 25  if country_n  == 3 & year == 2013
replace master_id = 26  if country_n  == 3 & year == 2016

replace master_id = -2  if country_n  == 4 & year == 1950
replace master_id = 27  if country_n  == 4 & year == 1953
replace master_id = 28  if country_n  == 4 & year == 1956
replace master_id = 29  if country_n  == 4 & year == 1959
replace master_id = 30  if country_n  == 4 & year == 1962
replace master_id = 31  if country_n  == 4 & year == 1966
replace master_id = 32  if country_n  == 4 & year == 1970
replace master_id = 33  if country_n  == 4 & year == 1971
replace master_id = 34  if country_n  == 4 & year == 1975
replace master_id = 35  if country_n  == 4 & year == 1979
replace master_id = 36  if country_n  == 4 & year == 1983
replace master_id = 37  if country_n  == 4 & year == 1986
replace master_id = 38  if country_n  == 4 & year == 1990
replace master_id = 39  if country_n  == 4 & year == 1994
replace master_id = 40  if country_n  == 4 & year == 1995
replace master_id = 41  if country_n  == 4 & year == 1999
replace master_id = 42  if country_n  == 4 & year == 2002
replace master_id = 43  if country_n  == 4 & year == 2006
replace master_id = 44  if country_n  == 4 & year == 2008
replace master_id = 45  if country_n  == 4 & year == 2013

replace master_id = -3  if country_n  == 14 & year == 1950
replace master_id = 46  if country_n  == 14 & year == 1953
replace master_id = 47  if country_n  == 14 & year == 1957
replace master_id = 48  if country_n  == 14 & year == 1958
replace master_id = 49  if country_n  == 14 & year == 1962
replace master_id = 50  if country_n  == 14 & year == 1963
replace master_id = 51  if country_n  == 14 & year == 1965
replace master_id = 52  if country_n  == 14 & year == 1968
replace master_id = 53  if country_n  == 14 & year == 1972
replace master_id = 54  if country_n  == 14 & year == 1974
replace master_id = 55  if country_n  == 14 & year == 1979 
replace master_id = 56  if country_n  == 14 & year == 1980 
replace master_id = 57  if country_n  == 14 & year == 1984
replace master_id = 58  if country_n  == 14 & year == 1988
replace master_id = 59  if country_n  == 14 & year == 1993
replace master_id = 60  if country_n  == 14 & year == 1997
replace master_id = 61  if country_n  == 14 & year == 2000
replace master_id = 62  if country_n  == 14 & year == 2004
replace master_id = 63  if country_n  == 14 & year == 2006
replace master_id = 64  if country_n  == 14 & year == 2008
replace master_id = 65  if country_n  == 14 & year == 2011
replace master_id = 66  if country_n  == 14 & year == 2015
														
replace master_id = -4  if country_n  == 22 & year == 1947
replace master_id = 67  if country_n  == 22 & year == 1950
replace master_id = 68  if country_n  == 22 & year == 1953 

replace master_id = 70 if country_n  == 22 & year == 1957
replace master_id = 71 if country_n  == 22 & year == 1960
replace master_id = 72 if country_n  == 22 & year == 1964
replace master_id = 73 if country_n  == 22 & year == 1966
replace master_id = 74 if country_n  == 22 & year == 1968
replace master_id = 75 if country_n  == 22 & year == 1971
replace master_id = 76 if country_n  == 22 & year == 1973 
replace master_id = 77 if country_n  == 22 & year == 1975 
replace master_id = 78 if country_n  == 22 & year == 1977
replace master_id = 79 if country_n  == 22 & year == 1979
replace master_id = 80 if country_n  == 22 & year == 1981
replace master_id = 81 if country_n  == 22 & year == 1984
replace master_id = 82 if country_n  == 22 & year == 1987
replace master_id = 83 if country_n  == 22 & year == 1988
replace master_id = 84 if country_n  == 22 & year == 1990
replace master_id = 85 if country_n  == 22 & year == 1994
replace master_id = 86 if country_n  == 22 & year == 1998
replace master_id = 87 if country_n  == 22 & year == 2001						
replace master_id = 88 if country_n  == 22 & year == 2005
replace master_id = 89 if country_n  == 22 & year == 2007
replace master_id = 90 if country_n  == 22 & year == 2011
replace master_id = 91 if country_n  == 22 & year == 2015									
								
replace master_id = -5 if country_n  == 28 & year == 1950
replace master_id = 92 if country_n  == 28 & year == 1951
replace master_id = 93 if country_n  == 28 & year == 1954
replace master_id = 94 if country_n  == 28 & year == 1958
replace master_id = 95 if country_n  == 28 & year == 1962
replace master_id = 96 if country_n  == 28 & year == 1966
replace master_id = 97 if country_n  == 28 & year == 1970
replace master_id = 98 if country_n  == 28 & year == 1972
replace master_id = 99 if country_n  == 28 & year == 1975
replace master_id = 100 if country_n  == 28 & year == 1979
replace master_id = 101 if country_n  == 28 & year == 1983 
replace master_id = 102 if country_n  == 28 & year == 1987 
replace master_id = 103 if country_n  == 28 & year == 1991
replace master_id = 104 if country_n  == 28 & year == 1995
replace master_id = 105 if country_n  == 28 & year == 1999
replace master_id = 106 if country_n  == 28 & year == 2003
replace master_id = 107 if country_n  == 28 & year == 2007
replace master_id = 108 if country_n  == 28 & year == 2011
replace master_id = 109 if country_n  == 28 & year == 2015

replace master_id = -6 if country_n  == 29 & year == 1950
replace master_id = 110 if country_n  == 29 & year == 1951
replace master_id = 111 if country_n  == 29 & year == 1956
replace master_id = 112 if country_n  == 29 & year == 1958
replace master_id = 113 if country_n  == 29 & year == 1962
replace master_id = 114 if country_n  == 29 & year == 1967
replace master_id = 115 if country_n  == 29 & year == 1968
replace master_id = 116 if country_n  == 29 & year == 1973
replace master_id = 117 if country_n  == 29 & year == 1978
replace master_id = 118 if country_n  == 29 & year == 1981
replace master_id = 119 if country_n  == 29 & year == 1986
replace master_id = 120 if country_n  == 29 & year == 1988 
replace master_id = 121 if country_n  == 29 & year == 1993 
replace master_id = 122 if country_n  == 29 & year == 1997
replace master_id = 123 if country_n  == 29 & year == 2002
replace master_id = 124 if country_n  == 29 & year == 2007
replace master_id = 125 if country_n  == 29 & year == 2012

replace master_id = -7  if country_n  == 30 & year == 1950
replace master_id = 126 if country_n  == 30 & year == 1953
replace master_id = 127 if country_n  == 30 & year == 1957
replace master_id = 128 if country_n  == 30 & year == 1961
replace master_id = 129 if country_n  == 30 & year == 1965
replace master_id = 130 if country_n  == 30 & year == 1969
replace master_id = 131 if country_n  == 30 & year == 1972
replace master_id = 132 if country_n  == 30 & year == 1976
replace master_id = 133 if country_n  == 30 & year == 1980
replace master_id = 134 if country_n  == 30 & year == 1983
replace master_id = 135 if country_n  == 30 & year == 1987
replace master_id = 136 if country_n  == 30 & year == 1990 
replace master_id = 137 if country_n  == 30 & year == 1994 
replace master_id = 138 if country_n  == 30 & year == 1998
replace master_id = 139 if country_n  == 30 & year == 2002
replace master_id = 140 if country_n  == 30 & year == 2005
replace master_id = 141 if country_n  == 30 & year == 2009
replace master_id = 142 if country_n  == 30 & year == 2013

replace master_id = -8  if country_n  == 31 & year == 1973
replace master_id = 143 if country_n  == 31 & year == 1974
replace master_id = 144 if country_n  == 31 & year == 1977
replace master_id = 145 if country_n  == 31 & year == 1981
replace master_id = 146 if country_n  == 31 & year == 1985 
replace master_id = 147 if country_n  == 31 & year == 1989 

replace master_id = 149 if country_n  == 31 & year == 1990
replace master_id = 150 if country_n  == 31 & year == 1993
replace master_id = 151 if country_n  == 31 & year == 1996
replace master_id = 152 if country_n  == 31 & year == 2000
replace master_id = 153 if country_n  == 31 & year == 2004
replace master_id = 154 if country_n  == 31 & year == 2007
replace master_id = 155 if country_n  == 31 & year == 2009
replace master_id = 156 if country_n  == 31 & year == 2012

replace master_id = 158 if country_n  == 31 & year == 2015 

replace master_id = -9  if country_n  == 37 & year == 1950
replace master_id = 160 if country_n  == 37 & year == 1953
replace master_id = 161 if country_n  == 37 & year == 1956
replace master_id = 162 if country_n  == 37 & year == 1959 

replace master_id = 164 if country_n  == 37 & year == 1963
replace master_id = 165 if country_n  == 37 & year == 1967
replace master_id = 166 if country_n  == 37 & year == 1971
replace master_id = 167 if country_n  == 37 & year == 1974
replace master_id = 168 if country_n  == 37 & year == 1978
replace master_id = 169 if country_n  == 37 & year == 1979 
replace master_id = 170 if country_n  == 37 & year == 1983 
replace master_id = 171 if country_n  == 37 & year == 1987
replace master_id = 172 if country_n  == 37 & year == 1991
replace master_id = 173 if country_n  == 37 & year == 1995
replace master_id = 174 if country_n  == 37 & year == 1999
replace master_id = 175 if country_n  == 37 & year == 2003
replace master_id = 176 if country_n  == 37 & year == 2007
replace master_id = 177 if country_n  == 37 & year == 2009
replace master_id = 178 if country_n  == 37 & year == 2013
replace master_id = 179 if country_n  == 37 & year == 2016

replace master_id = -10 if country_n  == 39 & year == 1950
replace master_id = 180 if country_n  == 39 & year == 1951
replace master_id = 181 if country_n  == 39 & year == 1954
replace master_id = 182 if country_n  == 39 & year == 1957
replace master_id = 183 if country_n  == 39 & year == 1961
replace master_id = 184 if country_n  == 39 & year == 1965
replace master_id = 185 if country_n  == 39 & year == 1969
replace master_id = 186 if country_n  == 39 & year == 1973
replace master_id = 187 if country_n  == 39 & year == 1977
replace master_id = 188 if country_n  == 39 & year == 1981
replace master_id = 189 if country_n  == 39 & year == 1982 

replace master_id = 191 if country_n  == 39 & year == 1987 
replace master_id = 192 if country_n  == 39 & year == 1989
replace master_id = 193 if country_n  == 39 & year == 1992
replace master_id = 194 if country_n  == 39 & year == 1997
replace master_id = 195 if country_n  == 39 & year == 2002
replace master_id = 196 if country_n  == 39 & year == 2007
replace master_id = 197 if country_n  == 39 & year == 2011
replace master_id = 198 if country_n  == 39 & year == 2016

replace master_id = -11 if country_n  == 41 & year == 1950
replace master_id = 199 if country_n  == 41 & year == 1953
replace master_id = 200 if country_n  == 41 & year == 1958
replace master_id = 201 if country_n  == 41 & year == 1963
replace master_id = 202 if country_n  == 41 & year == 1968
replace master_id = 203 if country_n  == 41 & year == 1972
replace master_id = 204 if country_n  == 41 & year == 1976
replace master_id = 205 if country_n  == 41 & year == 1979
replace master_id = 206 if country_n  == 41 & year == 1983
replace master_id = 207 if country_n  == 41 & year == 1987
replace master_id = 208 if country_n  == 41 & year == 1992
replace master_id = 209 if country_n  == 41 & year == 1994 
replace master_id = 210 if country_n  == 41 & year == 1996 
replace master_id = 211 if country_n  == 41 & year == 2001
replace master_id = 212 if country_n  == 41 & year == 2006
replace master_id = 213 if country_n  == 41 & year == 2008
replace master_id = 214 if country_n  == 41 & year == 2013

replace master_id = -20 if country_n  == 47 & year == 1950
replace master_id = 215 if country_n  == 47 & year == 1951
replace master_id = 216 if country_n  == 47 & year == 1954
replace master_id = 217 if country_n  == 47 & year == 1959
replace master_id = 218 if country_n  == 47 & year == 1964
replace master_id = 219 if country_n  == 47 & year == 1968
replace master_id = 220 if country_n  == 47 & year == 1974
replace master_id = 221 if country_n  == 47 & year == 1979
replace master_id = 222 if country_n  == 47 & year == 1984
replace master_id = 223 if country_n  == 47 & year == 1989
replace master_id = 224 if country_n  == 47 & year == 1994 
replace master_id = 225 if country_n  == 47 & year == 1999 
replace master_id = 226 if country_n  == 47 & year == 2004
replace master_id = 227 if country_n  == 47 & year == 2009
replace master_id = 228 if country_n  == 47 & year == 2013

replace master_id = -21 if country_n  == 50 & year == 1965
replace master_id = 229 if country_n  == 50 & year == 1966
replace master_id = 230 if country_n  == 50 & year == 1971
replace master_id = 231 if country_n  == 50 & year == 1976
replace master_id = 232 if country_n  == 50 & year == 1981
replace master_id = 233 if country_n  == 50 & year == 1987
replace master_id = 234 if country_n  == 50 & year == 1992
replace master_id = 235 if country_n  == 50 & year == 1996
replace master_id = 236 if country_n  == 50 & year == 1998
replace master_id = 237 if country_n  == 50 & year == 2003
replace master_id = 238 if country_n  == 50 & year == 2008
replace master_id = 239 if country_n  == 50 & year == 2013

replace master_id = -12 if country_n  == 53 & year == 1950
replace master_id = 240 if country_n  == 53 & year == 1952
replace master_id = 241 if country_n  == 53 & year == 1956
replace master_id = 242 if country_n  == 53 & year == 1959
replace master_id = 243 if country_n  == 53 & year == 1963
replace master_id = 244 if country_n  == 53 & year == 1967
replace master_id = 245 if country_n  == 53 & year == 1971
replace master_id = 246 if country_n  == 53 & year == 1972
replace master_id = 247 if country_n  == 53 & year == 1977
replace master_id = 248 if country_n  == 53 & year == 1981
replace master_id = 249 if country_n  == 53 & year == 1982 
replace master_id = 250 if country_n  == 53 & year == 1986 
replace master_id = 251 if country_n  == 53 & year == 1989
replace master_id = 252 if country_n  == 53 & year == 1994
replace master_id = 253 if country_n  == 53 & year == 1998
replace master_id = 254 if country_n  == 53 & year == 2002
replace master_id = 255 if country_n  == 53 & year == 2003
replace master_id = 256 if country_n  == 53 & year == 2006
replace master_id = 257 if country_n  == 53 & year == 2010
replace master_id = 258 if country_n  == 53 & year == 2012

replace master_id = -13 if country_n  == 54 & year == 1950
replace master_id = 259 if country_n  == 54 & year == 1951
replace master_id = 260 if country_n  == 54 & year == 1954
replace master_id = 261 if country_n  == 54 & year == 1957
replace master_id = 262 if country_n  == 54 & year == 1960
replace master_id = 263 if country_n  == 54 & year == 1963
replace master_id = 264 if country_n  == 54 & year == 1966
replace master_id = 265 if country_n  == 54 & year == 1969
replace master_id = 266 if country_n  == 54 & year == 1972
replace master_id = 267 if country_n  == 54 & year == 1975
replace master_id = 268 if country_n  == 54 & year == 1978 
replace master_id = 269 if country_n  == 54 & year == 1981 
replace master_id = 270 if country_n  == 54 & year == 1984
replace master_id = 271 if country_n  == 54 & year == 1987
replace master_id = 272 if country_n  == 54 & year == 1990
replace master_id = 273 if country_n  == 54 & year == 1993
replace master_id = 274 if country_n  == 54 & year == 1996
replace master_id = 275 if country_n  == 54 & year == 1999
replace master_id = 276 if country_n  == 54 & year == 2002
replace master_id = 277 if country_n  == 54 & year == 2005
replace master_id = 278 if country_n  == 54 & year == 2008
replace master_id = 279 if country_n  == 54 & year == 2011						
replace master_id = 280 if country_n  == 54 & year == 2014

replace master_id = -14 if country_n  == 56 & year == 1950
replace master_id = 281 if country_n  == 56 & year == 1953
replace master_id = 282 if country_n  == 56 & year == 1957
replace master_id = 283 if country_n  == 56 & year == 1961
replace master_id = 284 if country_n  == 56 & year == 1965
replace master_id = 285 if country_n  == 56 & year == 1969
replace master_id = 286 if country_n  == 56 & year == 1973
replace master_id = 287 if country_n  == 56 & year == 1977
replace master_id = 288 if country_n  == 56 & year == 1981
replace master_id = 289 if country_n  == 56 & year == 1985
replace master_id = 290 if country_n  == 56 & year == 1989 
replace master_id = 291 if country_n  == 56 & year == 1993 
replace master_id = 292 if country_n  == 56 & year == 1997
replace master_id = 293 if country_n  == 56 & year == 2001
replace master_id = 294 if country_n  == 56 & year == 2005
replace master_id = 295 if country_n  == 56 & year == 2009
replace master_id = 296 if country_n  == 56 & year == 2013

replace master_id = -21 if country_n  == 112 & year == 1975
replace master_id = 297 if country_n  == 62 & year == 1976
replace master_id = 298 if country_n  == 62 & year == 1979
replace master_id = 299 if country_n  == 62 & year == 1980
replace master_id = 300 if country_n  == 62 & year == 1983
replace master_id = 301 if country_n  == 62 & year == 1985
replace master_id = 302 if country_n  == 62 & year == 1987
replace master_id = 303 if country_n  == 62 & year == 1991
replace master_id = 304 if country_n  == 62 & year == 1995
replace master_id = 305 if country_n  == 62 & year == 1999
replace master_id = 306 if country_n  == 62 & year == 2002
replace master_id = 307 if country_n  == 62 & year == 2005
replace master_id = 308 if country_n  == 62 & year == 2009 
replace master_id = 309 if country_n  == 62 & year == 2011 
replace master_id = 310 if country_n  == 62 & year == 2015

replace master_id = -22 if country_n  == 71 & year == 1976
replace master_id = 311 if country_n  == 71 & year == 1977
replace master_id = 312 if country_n  == 71 & year == 1979
replace master_id = 313 if country_n  == 71 & year == 1982
replace master_id = 314 if country_n  == 71 & year == 1986
replace master_id = 315 if country_n  == 71 & year == 1989
replace master_id = 316 if country_n  == 71 & year == 1993
replace master_id = 317 if country_n  == 71 & year == 1996
replace master_id = 318 if country_n  == 71 & year == 2000
replace master_id = 319 if country_n  == 71 & year == 2004
replace master_id = 320 if country_n  == 71 & year == 2008
replace master_id = 321 if country_n  == 71 & year == 2011
replace master_id = 322 if country_n  == 71 & year == 2015
replace master_id = 323 if country_n  == 71 & year == 2016 

replace master_id = -15 if country_n  == 73 & year == 1950
replace master_id = 324 if country_n  == 73 & year == 1952
replace master_id = 325 if country_n  == 73 & year == 1956
replace master_id = 326 if country_n  == 73 & year == 1958
replace master_id = 327 if country_n  == 73 & year == 1960
replace master_id = 328 if country_n  == 73 & year == 1964
replace master_id = 329 if country_n  == 73 & year == 1968
replace master_id = 330 if country_n  == 73 & year == 1970
replace master_id = 331 if country_n  == 73 & year == 1973
replace master_id = 332 if country_n  == 73 & year == 1976
replace master_id = 333 if country_n  == 73 & year == 1979
replace master_id = 334 if country_n  == 73 & year == 1982 
replace master_id = 335 if country_n  == 73 & year == 1985 
replace master_id = 336 if country_n  == 73 & year == 1988
replace master_id = 337 if country_n  == 73 & year == 1991
replace master_id = 338 if country_n  == 73 & year == 1994
replace master_id = 339 if country_n  == 73 & year == 1998
replace master_id = 340 if country_n  == 73 & year == 2002
replace master_id = 341 if country_n  == 73 & year == 2006
replace master_id = 342 if country_n  == 73 & year == 2010
replace master_id = 343 if country_n  == 73 & year == 2014

replace master_id = -16 if country_n  == 74 & year == 1950
replace master_id = 344 if country_n  == 74 & year == 1951
replace master_id = 345 if country_n  == 74 & year == 1955
replace master_id = 346 if country_n  == 74 & year == 1959
replace master_id = 347 if country_n  == 74 & year == 1963
replace master_id = 348 if country_n  == 74 & year == 1967
replace master_id = 349 if country_n  == 74 & year == 1971
replace master_id = 350 if country_n  == 74 & year == 1975
replace master_id = 351 if country_n  == 74 & year == 1979
replace master_id = 352 if country_n  == 74 & year == 1983
replace master_id = 353 if country_n  == 74 & year == 1987
replace master_id = 354 if country_n  == 74 & year == 1991 
replace master_id = 355 if country_n  == 74 & year == 1995 
replace master_id = 356 if country_n  == 74 & year == 1999
replace master_id = 357 if country_n  == 74 & year == 2003
replace master_id = 358 if country_n  == 74 & year == 2007
replace master_id = 359 if country_n  == 74 & year == 2011
replace master_id = 360 if country_n  == 74 & year == 2015

replace master_id = -17 if country_n  == 78 & year == 1945
replace master_id = 361 if country_n  == 78 & year == 1950
replace master_id = 362 if country_n  == 78 & year == 1951
replace master_id = 363 if country_n  == 78 & year == 1955
replace master_id = 364 if country_n  == 78 & year == 1959
replace master_id = 365 if country_n  == 78 & year == 1964
replace master_id = 366 if country_n  == 78 & year == 1966
replace master_id = 367 if country_n  == 78 & year == 1970
replace master_id = 368 if country_n  == 78 & year == 1974 

replace master_id = 370 if country_n  == 78 & year == 1979 
replace master_id = 371 if country_n  == 78 & year == 1983 
replace master_id = 372 if country_n  == 78 & year == 1987 
replace master_id = 373 if country_n  == 78 & year == 1992
replace master_id = 374 if country_n  == 78 & year == 1997
replace master_id = 375 if country_n  == 78 & year == 2001
replace master_id = 376 if country_n  == 78 & year == 2005
replace master_id = 377 if country_n  == 78 & year == 2010
replace master_id = 378 if country_n  == 78 & year == 2015

replace master_id = 379 if country_n  == 7 & year == 1950
replace master_id = 380 if country_n  == 7 & year == 1954
replace master_id = 381 if country_n  == 7 & year == 1958
replace master_id = 382 if country_n  == 7 & year == 1961
replace master_id = 383 if country_n  == 7 & year == 1965
replace master_id = 384 if country_n  == 7 & year == 1968
replace master_id = 385 if country_n  == 7 & year == 1971
replace master_id = 386 if country_n  == 7 & year == 1974
replace master_id = 387 if country_n  == 7 & year == 1977
replace master_id = 388 if country_n  == 7 & year == 1978
replace master_id = 389 if country_n  == 7 & year == 1981 
replace master_id = 390 if country_n  == 7 & year == 1985 
replace master_id = 391 if country_n  == 7 & year == 1987
replace master_id = 392 if country_n  == 7 & year == 1991
replace master_id = 393 if country_n  == 7 & year == 1995
replace master_id = 394 if country_n  == 7 & year == 1999
replace master_id = 395 if country_n  == 7 & year == 2003
replace master_id = 396 if country_n  == 7 & year == 2007
replace master_id = 397 if country_n  == 7 & year == 2010
replace master_id = 398 if country_n  == 7 & year == 2014


drop if master_id ==.
bysort country_n (year): gen lagged_RAI = n_RAI[_n-1]
drop if master_id < 0


save "$data1\RAImerge.dta", replace
clear
use  "$data1\Study1Combined.dta"

capture drop _merge
merge 1:1 master_id using "$data1\RAImerge.dta"
drop _merge

bysort FEcountry (edate): replace n_RAI = n_RAI[_n -1] if n_RAI ==. 
bysort FEcountry (edate): replace n_RAI = n_RAI[_n +1] if n_RAI ==. 
bysort FEcountry (edate): gen lag_RAI = lagged_RAI
drop lagged_RAI

bysort FEcountry (edate): replace lag_RAI = n_RAI[_n -1] if lag_RAI ==. 
bysort FEcountry (edate): replace lag_RAI = n_RAI if lag_RAI ==. 
drop if master_id < 0


//* Assign Flanders' values to Wallonia on a number of variables 

gen Belg_sep =.
replace Belg_sep = 1 if inrange(countryelection,379,418)
order Belg_sep, after(countryelection)
sort Belg_sep edate



bysort Belg_sep (edate): replace pop = pop[_n -1] if pop ==. & Belg_sep !=.
bysort Belg_sep (edate): replace rgdpna   = rgdpna[_n-1] if rgdpna ==. & Belg_sep !=.
bysort Belg_sep (edate): replace PC_rgdpna =  PC_rgdpna[_n-1] if PC_rgdpna ==. & Belg_sep !=.
bysort Belg_sep (edate): replace lag_rgdpnaPC =  lag_rgdpnaPC[_n-1] if lag_rgdpnaPC ==. & Belg_sep !=.
bysort Belg_sep (edate): replace lag2GR_rgdpnaPC =  lag2GR_rgdpnaPC[_n-1] if lag2GR_rgdpnaPC ==. & Belg_sep !=.
bysort Belg_sep (edate): replace log_lagGDPpc =  log_lagGDPpc[_n-1] if log_lagGDPpc ==. & Belg_sep !=.
bysort Belg_sep (edate): replace openness =  openness[_n-1] if openness ==. & Belg_sep !=. & master_id != 450 & master_id != 465
bysort Belg_sep (edate): replace lag_openness =  lag_openness[_n-1] if lag_openness ==. & Belg_sep !=. & master_id != 450 & master_id != 465
bysort Belg_sep (edate): replace tier1_avemag =  tier1_avemag[_n-1] if tier1_avemag ==. & Belg_sep !=.
bysort Belg_sep (edate): replace lagged_tier1 =   lagged_tier1[_n-1] if  lagged_tier1 ==. & Belg_sep !=.
bysort Belg_sep (edate): replace tier2_avemag =  tier2_avemag[_n-1] if tier2_avemag ==. & Belg_sep !=.
bysort Belg_sep (edate): replace lagged_tier2  =    lagged_tier2[_n-1] if   lagged_tier2  ==. & Belg_sep !=.
bysort Belg_sep (edate): replace decisive =  decisive[_n-1] if decisive ==. & Belg_sep !=.
bysort Belg_sep (edate): replace lagged_decisive =  lagged_decisive[_n-1] if lagged_decisive ==. & Belg_sep !=.
bysort Belg_sep (edate): replace effective_thresh =  effective_thresh[_n-1] if effective_thresh ==. & Belg_sep !=.
bysort Belg_sep (edate): replace lagged_effecthresh =  lagged_effecthresh[_n-1] if lagged_effecthresh ==. & Belg_sep !=.
bysort Belg_sep (edate): replace legal_thresh =  legal_thresh[_n-1] if legal_thresh ==. & Belg_sep !=.
bysort Belg_sep (edate): replace lagged_legalthresh =  lagged_legalthresh[_n-1] if lagged_legalthresh ==. & Belg_sep !=.
bysort Belg_sep (edate): replace threshold  =  threshold[_n-1] if threshold  ==. & Belg_sep !=.
bysort Belg_sep (edate): replace lagged_thresh =  lagged_thresh[_n-1] if lagged_thresh ==. & Belg_sep !=.
bysort Belg_sep (edate): replace uptier_decisive =  uptier_decisive[_n-1] if uptier_decisive ==. & Belg_sep !=.
bysort Belg_sep (edate): replace upperseats =  upperseats[_n-1] if upperseats ==. & Belg_sep !=.
bysort Belg_sep (edate): replace tier2_districts =  tier2_districts[_n-1] if tier2_districts ==. & Belg_sep !=.
bysort Belg_sep (edate): replace n_RAI =  n_RAI[_n-1] if n_RAI ==. & Belg_sep !=.
bysort Belg_sep (edate): replace lag_RAI  =  lag_RAI[_n-1] if lag_RAI  ==. & Belg_sep !=.


save  "$data1\Study1Combined.dta", replace
clear 

*** CMP Convergence Data ***

use "$data1\MPDataset_MPDS2019a_stata14" // Manifesto Project 2019a Edition (Downloaded: 05/11/19)
 
 
 * For Norway 1989 (no total number of quasi-statements are available) use party averages for the country instead * 
 
 replace total = 1365 if party == 12810 & total ==.
 replace total = 1018 if party == 12620 & total ==.
 replace total = 1255 if party == 12320 & total ==.
 replace total =  948 if party == 12520 & total ==.
 replace total = 1469 if party == 12221 & total ==.
 replace total = 1520 if party == 12951 & total ==.
 replace total = 1018 if party == 12420 & total ==.
 
 * Drop non-featured countries *
 
 keep if inrange(country,11,15) | inrange(country,21,23) | inrange(country,31,35) | inrange(country,41,43) | country == 51 | country == 53 | country == 54 | inrange(country,62,64)
 
 * Generate Year *
 
gen yr = yofd(edate)
order yr, after(edate)

 * Generate relation to system *
 
 gen type =.
 label variable type "Relation to the System"
 label define type 1 "Mainstream" 2 "Complementary Party" 3 "Half-Way House" 4 "Anti-System" 
 label values type type
 
 order type, after(party)
 

 ******* AUSTRALIA **********
 
  replace type = 4 if party == 63110 & yr <= 2007 //* Australian Greens
  replace type = 2 if party == 63110 & yr == 2010
  replace type = 1 if party == 63110 & yr >  2010
 
  replace type = 1 if party == 63320 //* Australian Labor Party
 
  replace type = 1 if party == 63810 //* Country / National Party
 
  replace type = 1 if party == 63622 //* Country Liberal Party
 
  replace type = 1 if party == 63620 //* Liberal Party of Australia
 
  replace type = 1 if party == 63621 //* Liberal National Party of Queensland

  replace type = 4 if party == 63710 //* Katter's Australian Party
 
  replace type = 2 if party == 63321 //* Australian Democrats
 
  replace type = 2 if party == 63330 //* Anti-Communist LP / Democratic Labor Party
 
  replace type = 2 if party == 63410 //* Palmer UTD
  
  replace type = 2 if party == 63901 //* Nick Xenophon Team
  
  
 ******* AUSTRIA **********
  
  replace type = 4 if party == 42110 & yr <= 1999 //* The Greens 
  replace type = 2 if party == 42110 & yr >= 2002
 
  replace type = 2 if party == 42220 & yr == 1945 //* Austrian Communist Party
  replace type = 4 if party == 42220 & yr >= 1949
 
  replace type = 2 if party == 42320 & yr == 1945 //* Social Democratic Party
  replace type = 1 if party == 42320 & yr >= 1949
 
  replace type = 4 if party == 42420 & yr <= 1956  //* Austrian Freedom Party
  replace type = 3 if party == 42420 & inrange(yr,1959,1970)
  replace type = 1 if party == 42420 & inrange(yr,1971,1983)
  replace type = 3 if party == 42420 & yr == 1986
  replace type = 4 if party == 42420 & inrange(yr,1990,2001)
  replace type = 3 if party == 42420 & yr == 2002
  replace type = 4 if party == 42420 & yr >= 2006
 
  replace type = 2 if party == 42421 & yr <  2008 //* Liberal Forum
  replace type = 1 if party == 42421 & yr >= 2008
 
  replace type = 2 if party == 42430 //* NEOS / New Austria (c)
 
  replace type = 2 if party == 42520 & yr == 1945 //* Austrian People's Party
  replace type = 1 if party == 42520 & yr >= 1949
 
  replace type = 3 if party == 42710 //* BZO / Alliance for the Future of Austria
 
  replace type = 4 if party == 42951 //* Team Stronach
 
  replace type = 2 if party == 42120 //* Peter Pilz List
 
 
 ********** BELGIUM **********
 
  replace type = 4 if party == 21111 & yr  < 1995  //* ECOLO (Wallonia Greens)
  replace type = 2 if party == 21111 & inrange(yr,1995,1999)
  replace type = 1 if party == 21111 & yr >= 2003
 
  replace type = 4 if party == 21112 & yr  < 1995 //* AGALEV (Flemish Greens)
  replace type = 2 if party == 21112 & inrange(yr,1995,1999)
  replace type = 1 if party == 21112 & yr >= 2003

  replace type = 1 if party == 21320 //* Belgian Socialist Party
 
  replace type = 1 if party == 21321 //* Socialist Party Flanders
  replace type = 1 if party == 21221 & inrange(yr,2003,2007) //* Socialist Party (Flanders)
 
  replace type = 1 if party == 21322 //* Socialist Party Wallonia
 
  replace type = 1 if party == 21520 //* Christian Democratic Party of Belgium
 
  replace type = 1 if party == 21522 //* Christian Social Party (Wallonia)
  replace type = 1 if party == 21330 //* SPIRIT / CVV (2007)

  replace type = 1 if party == 21521 //* Christian People's Party (Flanders)
 
  replace type = 1 if party == 21420 //* Liberal Party of Belgium 
  
  replace type = 1 if party == 21421 //* Liberal Party of Flanders
 
  replace type = 1 if party == 21422 //* Liberal Party of Wallonia
  replace type = 1 if party == 21423 //* Liberal Reform Party - Francophone Federation Cartel (1995)
  replace type = 1 if party == 21425 //* Liberal Reform Party - FDF Alliance (1999)
  replace type = 1 if party == 21426 //* Liberal Reform Movement (Wallonia)
 
  replace type = 1 if party == 21424 //* Liberal Party of Brussels
 
  replace type = 4 if party == 21430 //* Dedecker List 
 
  replace type = 4 if party == 21230 //* Worker's Party of Belgium
 
  replace type = 4 if party == 21911 & yr < 1975 //* Walloon Rally
  replace type = 1 if party == 21911 & yr > 1975
 
  replace type = 2 if party == 21912 & yr <= 1977 //* Federal Democratic Front (FDF)
  replace type = 1 if party == 21912 & yr >= 1978
 
  replace type = 4 if party == 21913 & yr <= 1977 //*  People's Union / Flemish Christian Union 
  replace type = 1 if party == 21913 & yr >= 1978
  replace type = 1 if party == 21915 //* People's Union - 21st Century Democracy Cartel (1999)
 
  replace type = 4 if party == 21914 //* Flemish Block    (1978 - 2003)
  replace type = 4 if party == 21917 //* Flemish Interest (2007 -)

  replace type = 4 if party == 21916 & yr <= 2003 //* New Flemish Alliance
  replace type = 3 if party == 21916 & yr >  2004
 
  
 ********** CANADA **********
  
  replace type = 2 if party == 62110 //* Green Party (2008 - )
  
  replace type = 4 if party == 62320 & yr <= 1953 //* CCF / New Democratic Party
  replace type = 2 if party == 62320 & inrange(yr,1957,1972)
  replace type = 1 if party == 62320 & yr >= 1974
  
  replace type = 1 if party == 62620 //* Progressive Conservative Party (1945 - 2000)
  replace type = 1 if party == 62623 //* Conservative Party of Canada (2004 - 2015)
  
  replace type = 1 if party == 62420 //* Liberal Party of Canada

  replace type = 4 if party == 62621 //* Reform Party Party of Canada (1993 - 1997)
  replace type = 4 if party == 62622 //* Reform Alliance (2000)

  replace type = 4 if party == 62901 //* Quebec Bloc

  replace type = 4 if party == 62951 //* Social Credit Party

 
 ********** DENMARK **********
 
  replace type = 2 if party == 13001 //* New Alliance / Liberal Alliance (2007 - 2015)
 
  replace type = 4 if party == 13210 //* Left Socialist Party
 
  replace type = 4 if party == 13220 //* Danish Communist Party
 
  replace type = 4 if party == 13221 //* Common Course

  replace type = 4 if party == 13229 & yr <= 1998 //* Red-Green Unity List / Left Alliance
  replace type = 3 if party == 13229 & yr >  1998
 
  replace type = 4 if party == 13230 & yr <= 1966 //* Socialist People's Party
  replace type = 3 if party == 13230 & inrange(yr,1968,1990)
  replace type = 1 if party == 13230 & yr >= 1994

  replace type = 1 if party == 13320 //* Social Democratic Party
 
  replace type = 2 if party == 13330 & yr <= 1984 //* Centre Democrats
  replace type = 1 if party == 13330 & yr >= 1987
  
  replace type = 1 if party == 13410 //* Danish Social-Liberal Party
 
  replace type = 1 if party == 13420 //* Venstre / Liberals
 
  replace type = 2 if party == 13421 //* Independent's Party / Uafh
  
  replace type = 2 if party == 13422 //* Liberal Centre
  
  replace type = 2 if party == 13520 & yr <= 1984 //* Christian People's / Christian Democrats
  replace type = 1 if party == 13520 & yr >= 1987
  
  replace type = 1 if party == 13620 //* Conservative People's Party
  
  replace type = 4 if party == 13720 & yr <= 2001 //* Danish People's Party
  replace type = 3 if party == 13720 & yr >= 2005
  
  replace type = 4 if party == 13951 //* Progress Party
  
  replace type = 2 if party == 13952 & yr <= 1957 //* Justice Party
  replace type = 1 if party == 13952 & yr >= 1960
  
  replace type = 4 if party == 13953 //* Danish Union
  
  
 ********** FINLAND **********
  
  replace type = 3 if party == 14221 & yr <= 1948 //* Finnish People's Dem Union (Comm)
  replace type = 4 if party == 14221 & inrange(yr,1951,1966)
  replace type = 3 if party == 14221 & yr >= 1970
  
  replace type = 4 if party == 14222 //* Democratic Alternative (Comm)
 
  replace type = 4 if party == 14110 & yr <= 1995 //* Green Union
  replace type = 1 if party == 14110 & yr >= 1999

  replace type = 4 if party == 14223 & yr <= 1995 //* Left Wing Alliance
  replace type = 3 if party == 14223 & inrange(yr,1999,2015)
 
  replace type = 1 if party == 14310 //* Social Democratic League
 
  replace type = 1 if party == 14320 //* Social Democrats
 
  replace type = 1 if party == 14420 //* National Progressive Party / Liberal People's Party
  
  replace type = 2 if party == 14430 //* Young Finnish Party
  
  replace type = 2 if party == 14520 & yr <= 1991 //* Finnish Christian Union / Christ Democrats / Christian League
  replace type = 1 if party == 14520 & yr >= 1995
  
  replace type = 1 if party == 14620 //* National Coalition Party
  
  replace type = 1 if party == 14810 //* Agrarian Union / Centre Party / Finnish Centre
  
  replace type = 4 if party == 14820 & yr <= 1983 //* Finnish Rural Party / True Finns
  replace type = 3 if party == 14820 & inrange(yr,1987,1995)
  replace type = 4 if party == 14820 & yr >= 1999 
  
  replace type = 1 if party == 14901  //* Swedish People's Party
  
  
 ********** FRANCE **********
  
  replace type = 4 if party == 31021 //*  Left Front
  replace type = 4 if party == 31240 //* Indomitable France / Left Party
	
  replace type = 4 if party == 31110 & yr <= 1993 //* Greens - Europe Ecology
  replace type = 1 if party == 31110 & yr >= 1997  
  
  replace type = 1 if party == 31111 //* Generation Ecology (1997)
  
  replace type = 3 if party == 31220 & yr <  1951 //* French Communist Party
  replace type = 4 if party == 31220 & inrange(yr,1951,1967)
  replace type = 3 if party == 31220 & inrange(yr,1968,1981)
  replace type = 4 if party == 31220 & inrange(yr,1986,1997)
  replace type = 3 if party == 31220 & yr == 2002
  replace type = 4 if party == 31220 & yr >= 2007
  
  replace type = 1 if party == 31230 //* Left Radical Party
  
  replace type = 1 if party == 31320 //* Socialist Party
  
  replace type = 1 if party == 31421 //* Radical Party
  
  replace type = 2 if party == 31425 //* En Marche
  
  replace type = 1 if party == 31430 //* Union of Democrats and Independents
 
  replace type = 1 if party == 31521 //* Popular Republican Movement
 
  replace type = 1 if party == 31522 //* Centre Democrats
 
  replace type = 1 if party == 31523 //* Centre, Democracy, and Progress
 
  replace type = 1 if party == 31529 //* Reform Movement
 
  replace type = 4 if party == 31621 & yr <= 1956 //* Rally for French People - Gaullists
  replace type = 1 if party == 31621 & yr >= 1958
 
  replace type = 1 if party == 31622 //* Republican Party of Liberty - National Centre of Independents / UDF
  replace type = 1 if party == 31624 //* UDF
 
  replace type = 4 if party == 31623 //* Poujadists / Union Defence of Traders and Artisans
  
  replace type = 1 if party == 31625 //* Rally for the Republic
 
  replace type = 1 if party == 31626 //* UMP / Union for a Popular Movement
 
  replace type = 1 if party == 31630 //* New Centre
 
  replace type = 1 if party == 31631 //* Centrist Alliance
 
  replace type = 4 if party == 31720 //* National Front
 
 
 ********** GERMANY **********
  
  replace type = 4 if party == 41111 //* The Greens (1983 - 1987)
 
  replace type = 4 if party == 41112 //* Greens / Bundis'90 (1990)
 
  replace type = 2 if party == 41113 & inrange(yr,1994,1998) //* Bundnis'90 / Greens (1994 -)
  replace type = 1 if party == 41113 & yr >= 2002
 
  replace type = 4 if party == 41220 //* Communist Party of Germany
 
  replace type = 4 if party == 41221 //* Party of Democratic Socialism
  replace type = 4 if party == 41222 //* The Left Party of Democratic Socialism
  replace type = 4 if party == 41223 //* The Left
 
  replace type = 2 if party == 41320 & yr <= 1965 //* Social Democratic Party of Germany
  replace type = 1 if party == 41320 & yr >= 1969 
 
  replace type = 2 if party == 41420 & yr <= 1949 //* Free Democratic Party (FDP)
  replace type = 1 if party == 41420 & yr >= 1953
 
  replace type = 2 if party == 41521 & yr <= 1949 //* CDU-CSU
  replace type = 1 if party == 41521 & yr >= 1953
 
  replace type = 2 if party == 41522 & inrange(yr,1949,1953) //* Centre Party

  replace type = 2 if party == 41620 & yr <= 1949 //* German Party
  replace type = 1 if party == 41620 & yr >= 1953

  replace type = 4 if party == 41711 //* Economic Reconstruction League
  
  replace type = 4 if party == 41712 //* German Reich Party
 
  replace type = 4 if party == 41911 //* Bavaria Party
 
  replace type = 2 if party == 41912 //* South Schleswig Party
 
  replace type = 2 if party == 41951 //* German Bloc of Expellees
 
  replace type = 4 if party == 41952 //* Pirate Party
 
  replace type = 4 if party == 41953 //* Alternative for Germany

 
 ********** GREECE **********
  
  replace type = 4 if party == 34210 //* Communist Party of Greece (1974-1985; 1993 - 2015)
 
  replace type = 4 if party == 34211 & yr == 1989 & date == 198906 //* Left and Progress Coalition
  replace type = 3 if party == 34211 & yr == 1989 & date == 198911
  replace type = 3 if party == 34211 & yr == 1990
  replace type = 4 if party == 34211 & yr >= 1993
  replace type = 4 if party == 34020 //* SYRIZA (2004-2012)
  replace type = 4 if party == 34212 & yr == 2012 & date == 201206
  replace type = 4 if party == 34212 & yr == 2015 & date == 201501 //* SYRIZA (2012-15)
  replace type = 3 if party == 34212 & yr == 2015 & date == 201509
  
  replace type = 2 if party == 34213 & yr == 2012 //* Democratic Left
  replace type = 1 if party == 34213 & yr == 2015 
 
  replace type = 4 if party == 34214 //* Popular Unity
 
  replace type = 4 if party == 34313 & yr <= 1981 //* PASOK
  replace type = 1 if party == 34313 & yr >= 1985 
 
  replace type = 4 if party == 34314 //* DIKKI / DemSoc Movement
 
  replace type = 2 if party == 34340 //* Potami / The River
 
  replace type = 2 if party == 34410 //* Union of Centrists
 
  replace type = 1 if party == 34510 //* Centre Union
 
  replace type = 1 if party == 34511 //* New Democracy
 
  replace type = 2 if party == 34512 //* Political Spring
 
  replace type = 4 if party == 34610 //* National Alignment
 
  replace type = 4 if party == 34710 & yr <= 2009 //* Popular Orthodox Rally
  replace type = 3 if party == 34710 & yr >= 2012
 
  replace type = 4 if party == 34720 //* Golden Dawn
 
  replace type = 4 if party == 34730 & yr <= 2015 //* Independent Greeks
  replace type = 3 if party == 34730 & yr == 2015 & pervote == 3.6
 
 
 ********** ICELAND **********
  
  replace type = 4 if party == 15111 & yr <= 2009 //* Left-Green Movement
  replace type = 3 if party == 15111 & yr >= 2013
  
  replace type = 3 if party == 15220 //* People's Alliance / United Socialist Party
  
  replace type = 1 if party == 15320 //* Social Democratic Party
  
  replace type = 2 if party == 15321 //* Social Democratic Federation
  
  replace type = 2 if party == 15322 & yr <= 1971 //* Union of Liberals and Leftists
  replace type = 1 if party == 15322 & yr == 1974
  
  replace type = 2 if party == 15323 //* National Awakening
  
  replace type = 1 if party == 15328 //* The Alliance (SDP Alliance)
  
  replace type = 1 if party == 15420 & inrange(yr,1999,2003) //* Liberal Party
  replace type = 4 if party == 15420 & yr >= 2007
  
  replace type = 4 if party == 15430 //* Citizens' Movement
  
  replace type = 4 if party == 15440 //* Bright Future
  
  replace type = 1 if party == 15620 //* Independence Party
  
  replace type = 4 if party == 15621 //* Citizens Party
  
  replace type = 2 if party == 15450 //* Reform Party
  
  replace type = 2 if party == 15710 //* National Preservation Party
  
  replace type = 1 if party == 15810 //* Progressive Party
  
  replace type = 4 if party == 15951 //* Women's Alliance
  
  replace type = 4 if party == 15952 //* Pirate Party
  
  
 ********** IRELAND **********
  
  replace type = 4 if party == 53021 //* United Left Alliance
  
  replace type = 4 if party == 53110 & yr <= 2002 //* Green Party of Ireland
  replace type = 2 if party == 53110 & yr == 2007
  replace type = 1 if party == 53110 & yr >= 2011
  
  replace type = 4 if party == 53220 //* Workers' Party
  
  replace type = 2 if party == 53221 & yr <= 1992 //* Democratic Left Party
  replace type = 1 if party == 53221 & yr >= 1997
  
  replace type = 4 if party == 53230 //* Socialist Party
  
  replace type = 4 if party == 53231 //* People Before Profit Alliance
  
  replace type = 4 if party == 53240 //* Anti-Austerity Alliance
  
  replace type = 4 if party == 53250 //* Workers and Unemployment Action
  
  replace type = 2 if party == 53320 & yr <= 1948 //* Labour Party
  replace type = 1 if party == 53320 & yr >= 1951
  
  replace type = 1 if party == 53321  //* Social Democrats
  
  replace type = 2 if party == 53420 & yr <= 1989 //* Progressive Democrats
  replace type = 1 if party == 53420 & yr >= 1992
  
  replace type = 2 if party == 53520 & yr <= 1948 //* Fine Gael
  replace type = 1 if party == 53520 & yr >= 1951
  
  replace type = 1 if party == 53620 //* Fianna Fail
  
  replace type = 4 if party == 53714 & yr <= 1948 //* Republican Party
  replace type = 3 if party == 53714 & inrange(yr,1951,1954)
  replace type = 4 if party == 53714 & yr >= 1957
 
  replace type = 4 if party == 53810 & yr <= 1948 //* Party of the Land
  replace type = 3 if party == 53810 & yr >= 1951
 
  replace type = 4 if party == 53951 //* Sinn Fein
  
  replace type = 2 if party == 53981 //* Independent Alliance
 
 
 ********** ITALY **********
  
  replace type = 4 if party == 32021 //* Civil Revolution
  
  replace type = 1 if party == 32022 //* Italy Europe Together 
  
  replace type = 4 if party == 32031 //* Free and Equal
  
  replace type = 1 if party == 32051 //* Popular Civic List 
  
  replace type = 1 if party == 32055 //* Us With Italy
  
  replace type = 1 if party == 32061 //* People of Freedom / Forza Italia
  
  replace type = 1 if party == 32090 //* SVP-PATT
  
  replace type = 4 if party == 32110 & yr <= 1992 //* Green Federation
  replace type = 2 if party == 32110 & yr == 1994
  replace type = 1 if party == 32110 & yr >= 1996
  
  replace type = 1 if party == 32111 //* The Sunflower
  
  replace type = 4 if party == 32210 //* Communist / Proletarian Unity
  
  replace type = 4 if party == 32211 //* Proletarian Democracy
  
  replace type = 4 if party == 32212 & yr <= 1996 //* Communist Refoundation Party
  replace type = 3 if party == 32212 & yr >= 2001
  
  replace type = 3 if party == 32213 //* Party of Italian Communists
  
  replace type = 4 if party == 32220 & yr <= 1976 //* Italian Communist Party
  replace type = 3 if party == 32220 & yr == 1979
  replace type = 4 if party == 32220 & inrange(yr,1983,1987)
  
  replace type = 2 if party == 32220 & yr == 1992 //* Democratic Party of the Left
  replace type = 1 if party == 32220 & yr >= 1994
  
  replace type = 3 if party == 32221 //* Rose in the Fist
  
  replace type = 3 if party == 32230 //* Left Ecology Freedom
  
  replace type = 4 if party == 32310 & inrange(yr,1976,1994) //* Radical Party / Panella List (c)
  replace type = 3 if party == 32310 & yr == 1996
  
  replace type = 4 if party == 32320 & yr <= 1953 //* Italian Socialist Party
  replace type = 2 if party == 32320 & yr == 1958
  replace type = 1 if party == 32320 & yr >= 1963
  replace type = 1 if party == 32322 //* Unified Italian Socialists
  
  replace type = 1 if party == 32321 //* Italian Renewal
  
  replace type = 1 if party == 32329 //* The Olive Tree
  
  replace type = 1 if party == 32330 //* Italian Democratic Socialist Party / Socialist Unity
  
  replace type = 1 if party == 32410 //* Italian Republican Party
  
  replace type = 1 if party == 32420 //* Italian Liberal Party
  
  replace type = 1 if party == 32421 //* The Daisy
  
  replace type = 1 if party == 32440 //* Democratic Party
  
  replace type = 1 if party == 32450 //* Democratic Centre
  
  replace type = 1 if party == 32460 //* Civic Choice
  
  replace type = 1 if party == 32520 //* Christian Democrats / Italian Popualr Party
  
  replace type = 1 if party == 32521 //* Christian Democratic Centre
  
  replace type = 1 if party == 32522 //* The White Flower
  
  replace type = 1 if party == 32528 //* Pact for Italy / Segni
  
  replace type = 2 if party == 32529 & yr == 1994 //* Democratic Alliance (c)
  replace type = 1 if party == 32529 & yr == 1996 //* Democratic Alliance (c)
  
  replace type = 1 if party == 32530 //* Union for Christian and Centre Democrats
  
  replace type = 4 if party == 32610 & yr == 1994 //* Forza Italia
  replace type = 1 if party == 32610 & yr > 1994
  
  replace type = 1 if party == 32629 //* House of Freedom
  
  replace type = 1 if party == 32611 //* New Italian Socialist Party
  
  replace type = 3 if party == 32630 //* Brothers of Italy
  
  replace type = 4 if party == 32640 //* Labour and Freedom List
  
  replace type = 4 if party == 32710 & yr <= 1994 //* Italian Social Movement
  replace type = 3 if party == 32710 & yr >= 1996 //* National Alliance (c)
  
  replace type = 4 if party == 32720 & yr <= 1996 //* Lega Nord
  replace type = 3 if party == 32720 & inrange(yr,2001,2013)
  replace type = 4 if party == 32720 & yr == 2018 
  
  replace type = 2 if party == 32901 //* European Democracy
  
  replace type = 4 if party == 32902 & yr <= 2001 //* Italy of Values
  replace type = 3 if party == 32902 & inrange(yr,2006,2008)
  
  replace type = 1 if party == 32903 //* Aosta Valley Liberty
  
  replace type = 1 if party == 32904 //* South Tyrolean People's Party
  
  replace type = 1 if party == 32906 //* Aosta Valley
  
  replace type = 4 if party == 32951 //* The Network / Movement for Democracy
  
  replace type = 2 if party == 32952 //* Italy in the World
  
  replace type = 1 if party == 32953 //* Popular Democratic Union for Europe
  
  replace type = 1 if party == 32955 //* Union for Prodi
  
  replace type = 4 if party == 32956 //* 5 Star Movement
  
  replace type = 2 if party == 32451 //* More Europe
	
 ********** LUXEMBOURG **********
  
   replace type = 4 if party == 23112 //* Green Alternative (1984-1989)
   replace type = 2 if party == 23113 //* Green Alternative (1994-2013)
  
   replace type = 2 if party == 23111 //* Green Left Ecological Initiative
 
   replace type = 4 if party == 23220 //* Communist Party of Luxembourg
  
   replace type = 4 if party == 23230 //* The Left
  
   replace type = 1 if party == 23320 //* Socialist Workers Party of Luxembourg
   
   replace type = 1 if party == 23420 //* Democratic Party
  
   replace type = 1 if party == 23520 //* Christian Social People's Party
  
   replace type = 4 if party == 23951 //* Alternative Democratic Reform Party
  
  
 ********** MALTA **********
  
  replace type = 1 if party == 54320 //* Labour Party
  
  replace type = 1 if party == 54620 //* Nationalist Party
  
  
 ********** NETHERLANDS **********
  
  replace type = 4 if party == 22110 & yr <= 2002 //* GreenLeft
  replace type = 2 if party == 22110 & yr >= 2003
  
  replace type = 4 if party == 22210 //* Communist Party of Netherlands
  
  replace type = 4 if party == 22220 //* Socialist Party
  
  replace type = 4 if party == 22230 //* Pacifist Socialist Party
  
  replace type = 1 if party == 22310 & yr <= 1977 //* Radical Political Party
  replace type = 4 if party == 22310 & yr >= 1981
  
  replace type = 1 if party == 22320 //* Labour Party
  
  replace type = 4 if party == 22330 & yr == 1967 //* Democrats 66'
  replace type = 3 if party == 22330 & inrange(yr,1971,2012)
  replace type = 1 if party == 22330 & yr >= 2017
  
  replace type = 2 if party == 22420 & yr <= 1948 //* Party for Freedom
  replace type = 1 if party == 22420 & yr >= 1952
  
  replace type = 4 if party == 22321 //* DENK
  
  replace type = 4 if party == 22430 //* Livable Netherlands
  
  replace type = 1 if party == 22521 //* Christian Democratic Appeal
  
  replace type = 1 if party == 22522 //* Catholic People's Party
  
  replace type = 1 if party == 22523 //* Anti-Revolutionary Party
  
  replace type = 2 if party == 22524 //* Democratic Socialists'70
  
  replace type = 1 if party == 22525 //* Christian Historical Union
  
  replace type = 2 if party == 22526 & yr <= 2006 //* Christian Union
  replace type = 1 if party == 22526 & yr >= 2010  
  
  replace type = 4 if party == 22527 //* Reformed Political Party
  
  replace type = 4 if party == 22528 //* Reformed Political Federation
  
  replace type = 4 if party == 22710 //* Centre Party
  
  replace type = 4 if party == 22711 //* Centre Democrats
  
  replace type = 4 if party == 22720 & yr <= 2002 //* Pim Fortuyn List
  replace type = 3 if party == 22720 & yr >= 2003 
  
  replace type = 4 if party == 22722 //* Party for Freedom (c)
  
  replace type = 2 if party == 22951 //* Party for Animals
  
  replace type = 4 if party == 22952 //* Reformed Political Party
  
  replace type = 2 if party == 22953 //* 50+
  
  replace type = 2 if party == 22954 //* General Elderly Alliance
  
  replace type = 2 if party == 22955 //* Union 55+
  
  replace type = 4 if party == 22730 //* Forum for Democracy
  
  
 ********** NEW ZEALAND **********
  
  replace type = 2 if party == 64110 & yr <= 1999 //* Green Party
  replace type = 1 if party == 64110 & yr >= 2002
  
  replace type = 1 if party == 64320 //* NZ Labour Party
  
  replace type = 4 if party == 64321 & yr <= 1993 //* Alliance
  replace type = 2 if party == 64321 & yr >= 1996  
  
  replace type = 4 if party == 64420 & yr <= 2008 //* ACT NZ
  replace type = 3 if party == 64420 & yr >= 2011   
  
  replace type = 2 if party == 64421 & yr <= 2002 //* United Future NZ
  replace type = 1 if party == 64421 & yr >= 2005 
  
  replace type = 1 if party == 64422 //* Anderton Progressives
  
  replace type = 1 if party == 64620 //* NZ National Party
  
  replace type = 4 if party == 64621 & yr <= 1996 //* NZ First Party
  replace type = 3 if party == 64621 & yr >= 1999  
  
  replace type = 1 if party == 64901 //* Maori Party
  
  replace type = 4 if party == 64902 //* Mana Party
  
  replace type = 4 if party == 64951 //* Social Credit 
  
  
 ********** NORWAY **********
  
  replace type = 3 if party == 12220 & yr <= 1945 //* Norwegian Communist Party
  replace type = 4 if party == 12220 & yr >= 1949    
  
  replace type = 4 if party == 12221 & yr <= 1997 //* Socialist Peope's/Left Party
  replace type = 2 if party == 12221 & inrange(yr,2001,2005) 
  replace type = 1 if party == 12221 & yr >= 2009

  replace type = 1 if party == 12320 //* Norwegian Labour Party
  
  replace type = 2 if party == 12410 //* New People's Party
  
  replace type = 1 if party == 12420 //* Liberal Party
  
  replace type = 2 if party == 12520 & yr <= 1961 //* Christian Democrats / Christian People's Party
  replace type = 1 if party == 12520 & yr >= 1965  
  
  replace type = 1 if party == 12620 //* Conservative Party
  
  replace type = 1 if party == 12810 //* Farmer's Party / Centre Party
 
  replace type = 4 if party == 12951 & yr <= 2001 //* Progress Party / Anders Lange
  replace type = 2 if party == 12951 & yr == 2005
  replace type = 1 if party == 12951 & yr >= 2009
  
  replace type = 4 if party == 12110 //* Green Party 
 
 ********** PORTUGAL **********
  
  replace type = 4 if party == 35110  //* Portuguese Green Party
  
  replace type = 4 if party == 35210 //* Popular Democratic Union
 
  replace type = 4 if party == 35211 //* Left Bloc
 
  replace type = 4 if party == 35220 //* Portugal Communist Party
 
  replace type = 4 if party == 35229 //* Unified Democratic Coalition
 
  replace type = 4 if party == 35310 //* Popular Democratic Movement
 
  replace type = 4 if party == 35311 & yr <= 1976 //* Socialist Party
  replace type = 1 if party == 35311 & yr >= 1979
  
  replace type = 2 if party == 35312 & yr <= 1985 //* Democratic Renewal Party
  replace type = 1 if party == 35312 & yr >= 1987
 
  replace type = 4 if party == 35313 & yr <= 1979 //* Popular Democratic Party / SDP
  replace type = 3 if party == 35313 & inrange(yr,1980,1983)
  replace type = 1 if party == 35313 & yr >= 1985
 
  replace type = 4 if party == 35315 //* Democratic Intervention
 
  replace type = 4 if party == 35316 //* Association of Independent SDPs
 
  replace type = 4 if party == 35317 //* Leftwing Union for Socialism
 
  replace type = 4 if party == 35520 & yr <= 1979 //* Social Democratic Center Party
  replace type = 3 if party == 35520 & inrange(yr,1980,1983)
  replace type = 1 if party == 35520 & yr >= 1985
 
  replace type = 4 if party == 35710 & yr < 1983 //* Popular Monarchist Party
  replace type = 3 if party == 35710 & yr >= 1983
 
  replace type = 2 if party == 35951 //* National Soldiarity Party
  
  replace type = 1 if party == 35060 //* Portugal Ahead
 
  replace type = 2 if party == 35120 //* People-Animals-Nature
  
 ********** SPAIN **********
  
  replace type = 4 if party == 33020 //* Popular Unity - Podemos
  replace type = 4 if party == 33025 //* Podemos
  replace type = 4 if party == 33096 //* Podemos
  replace type = 4 if party == 33097 //* In Tide Podemos     
  replace type = 4 if party == 33098 //* Compromise Podemos
  replace type = 4 if party == 33210 //* Podemos
  
  replace type = 3 if party == 33091 //* Future Yes (Basque Nat)
  
  replace type = 4 if party == 33092 //* Amaiur
  
  replace type = 4 if party == 33093 //* EQUO
  
  replace type = 4 if party == 33095 //* Eh Bildu - Basque Country Unite
  
  replace type = 4 if party == 33099 //* Democracy and Freedom
   
  replace type = 4 if party == 33220 & yr <= 1996 //* Communist Party of Spain (c) / United Left
  replace type = 3 if party == 33220 & inrange(yr,2000,2008) //* 2000 alliance with PSOE
  replace type = 4 if party == 33220 & yr >= 2011
  
  replace type = 2 if party == 33320 & yr <= 1982 //* PSOE
  replace type = 1 if party == 33320 & yr >= 1986
  
  replace type = 2 if party == 33420 //* Citizens
  
  replace type = 2 if party == 33430 & yr < 1978 //* Union of Democratic Centre
  replace type = 1 if party == 33430 & yr >= 1979
  
  replace type = 2 if party == 33438 //* Popular Democratic Party
  
  replace type = 2 if party == 33439 //* Liberal Party
  
  replace type = 2 if party == 33440 //* Union, Progress, and Democracy
  
  replace type = 1 if party == 33512 //* Centre Democrats
  
  replace type = 4 if party == 33610 & yr <= 1978 //* Popular Alliance / People's Party
  replace type = 2 if party == 33610 & yr == 1979
  replace type = 1 if party == 33610 & yr >= 1982  
  
  replace type = 2 if party == 33611 & yr <= 1979 //* Convergence and Union
  replace type = 1 if party == 33611 & inrange(yr,1982,2008)
  replace type = 3 if party == 33611 & yr > 2008
  
  replace type = 4 if party == 33905 & yr <= 2004 //* Catalan Republican Left
  replace type = 3 if party == 33905 & yr >= 2008  
  
  replace type = 2 if party == 33612 //* Asturias Forum
  
  replace type = 4 if party == 33906 & yr <= 1979 //* Andalusian Party
  replace type = 3 if party == 33906 & yr >= 1982   
  
  replace type = 4 if party == 33902 & yr <= 1993 //* Basque Nationalist Party
  replace type = 3 if party == 33902 & yr >= 1996  
  
  replace type = 2 if party == 33904 & yr <= 1979 //* Aragonese Party
  replace type = 1 if party == 33904 & yr >= 1981    
  
  replace type = 2 if party == 33901 & yr <= 1982 //* Basque Left
  replace type = 1 if party == 33901 & yr >= 1986   
  
  replace type = 4 if party == 33903 //* Basque Solidarity
  
  replace type = 4 if party == 33911 & yr == 2016 //* Democratic Convergence of Catalonia
  
  replace type = 1 if party == 33907 //* Canarian Coalition
  
  replace type = 4 if party == 33908 & yr <= 2004 //* Galician Nationalist Bloc
  replace type = 3 if party == 33908 & yr >= 2008  
   
  replace type = 4 if party == 33909 & yr <= 2004 //* Aragonist Council
  replace type = 3 if party == 33909 & yr >= 2008     
   
  replace type = 2 if party == 33910 & yr <= 1979 //* Navarrese People's Union
  replace type = 1 if party == 33910 & yr >= 1981    
   
  
   
 ********** SWEDEN **********
  
  replace type = 4 if party == 11110 & yr <= 1998 //* Green Ecology Party
  replace type = 3 if party == 11110 & inrange(yr,2002,2006)
  replace type = 1 if party == 11110 & yr >= 2010  
  
  replace type = 4 if party == 11220 & yr <= 1998 //* Communist Party of Sweden / Left Party
  replace type = 3 if party == 11220 & yr >= 2002  
  
  replace type = 1 if party == 11320 //* Social Democratic Labour Party
  
  replace type = 1 if party == 11420 //* People's Party / Liberals
  
  replace type = 1 if party == 11520 //* Christian Democrats
  
  replace type = 1 if party == 11620 //* Right Party / Moderate Coalition Party
  
  replace type = 4 if party == 11710 //* Sweden Democrats
 
  replace type = 1 if party == 11810 //* Agrarian / Center Party
 
  replace type = 4 if party == 11951 //* New Democracy
 
 
 ********** SWITZERLAND **********
  
  replace type = 2 if party == 43110 //* Green Party
  
  replace type = 2 if party == 43120 //* Green Liberal Party
 
  replace type = 4 if party == 43220 //* Swiss Labour Party
 
  replace type = 1 if party == 43320 //* Social Democratic Paryt of Switzerland
 
  replace type = 4 if party == 43321 //* Independents' Alliance
 
  replace type = 1 if party == 43420 //* Radical Democratic Party / Liberals
 
  replace type = 1 if party == 43520 //* Conservative People's Party

  replace type = 1 if party == 43530 //* Evangelical People's Party
 
  replace type = 2 if party == 43531 //* Liberal Party of Switzerland
 
  replace type = 2 if party == 43540 //* Christian Social Party
 
  replace type = 4 if party == 43710 //* National Action Party
 
  replace type = 4 if party == 43711 //* Federal Democratic Union
 
  replace type = 1 if party == 43810 & yr <= 1995 //* Farmers / Swiss People's Party
  replace type = 3 if party == 43810 & yr >= 1999
  
  replace type = 1 if party == 43811 //* Conservative Democratic Party
 
  replace type = 4 if party == 43901 //* Ticino League
 
  replace type = 4 if party == 43902 //* Geneva Citizens' Movement
 
  replace type = 4 if party == 43951 //* Swiss Motorists Party / Freedom Party
 
 
 ********** UNITED KINGDOM **********
 
  replace type = 4 if party == 51110 //* Green Party
  
  replace type = 4 if party == 51210 //* Sinn Fein
 
  replace type = 1 if party == 51320 //* Labour Party
 
  replace type = 1 if party == 51330 //* Social Democratic Party
 
  replace type = 1 if party == 51340 //* SDLP
  
  replace type = 1 if party == 51420 //* Liberal Party
 
  replace type = 1 if party == 51421 //* Liberal Democratic Party
 
  replace type = 1 if party == 51620 //* Conservative Party
 
  replace type = 1 if party == 51621 //* Ulster Unionist Party
 
  replace type = 4 if party == 51901 //* Plaid Cymru
 
  replace type = 4 if party == 51902 //* Scottish National Party
 
  replace type = 4 if party == 51903 //* Democratic Unionist Party
 
  replace type = 4 if party == 51951 //* UKIP

  
 order rile, after(pervote)
 
  * Drop Wallonia/Flan (1968-) from above
 
 drop if country == 21 & date >= 196803
 

 * Drop (6) instances of missing programmes (1 * Greece 09; 4 * Greece 15b; 1 * Switz 11 - All non-Mainstrream parties)

 drop if pervote == . //* Exclude:  Was in an electoral coalition.
 drop if progtype == 99 //* Exclude: Missing programmes.
 drop if type != 1 //* Exclude: Non-mainstream party.
 
 * Drop unused variables *
 
  drop countryname peruncod partyname oecdmember eumember date partyabbrev parfam coderid manual coderyear ///
  testresult testeditsim voteest presvote absseat totseats datasetorigin corpusversion ///
  planeco markeco welfare intpeace datasetversion id_perm

 * Party Position Generators (from Prosser 2014)
 
gen raw101 = (per101/100)*total
gen raw102 = (per102/100)*total
gen raw103 = (per103/100)*total
gen raw104 = (per104/100)*total
gen raw105 = (per105/100)*total
gen raw106 = (per106/100)*total
gen raw107 = (per107/100)*total
gen raw108 = (per108/100)*total
gen raw109 = (per109/100)*total
gen raw110 = (per110/100)*total
gen raw201 = (per201/100)*total
gen raw202 = (per202/100)*total
gen raw203 = (per203/100)*total
gen raw204 = (per204/100)*total
gen raw301 = (per301/100)*total
gen raw302 = (per302/100)*total
gen raw303 = (per303/100)*total
gen raw304 = (per304/100)*total
gen raw305 = (per305/100)*total
gen raw401 = (per401/100)*total
gen raw402 = (per402/100)*total
gen raw403 = (per403/100)*total
gen raw404 = (per404/100)*total
gen raw405 = (per405/100)*total
gen raw406 = (per406/100)*total
gen raw407 = (per407/100)*total
gen raw408 = (per408/100)*total
gen raw409 = (per409/100)*total
gen raw410 = (per410/100)*total
gen raw411 = (per411/100)*total
gen raw412 = (per412/100)*total
gen raw413 = (per413/100)*total
gen raw414 = (per414/100)*total
gen raw415 = (per415/100)*total
gen raw416 = (per416/100)*total
gen raw501 = (per501/100)*total
gen raw502 = (per502/100)*total
gen raw503 = (per503/100)*total
gen raw504 = (per504/100)*total
gen raw505 = (per505/100)*total
gen raw506 = (per506/100)*total
gen raw507 = (per507/100)*total
gen raw601 = (per601/100)*total
gen raw602 = (per602/100)*total
gen raw603 = (per603/100)*total
gen raw604 = (per604/100)*total
gen raw605 = (per605/100)*total
gen raw606 = (per606/100)*total
gen raw607 = (per607/100)*total
gen raw608 = (per608/100)*total
gen raw701 = (per701/100)*total
gen raw702 = (per702/100)*total
gen raw703 = (per703/100)*total
gen raw704 = (per704/100)*total
gen raw705 = (per705/100)*total
gen raw706 = (per706/100)*total

*The second stage calculates the three scale variables
*gen_lr is the one dimensional general left-right scale
*econ_lr is the economic left-right scale from the two dimensional scale set
*social_lc is the social liberal-conserative scale from the two dimensional scale set

gen gen_lr = log((raw109 + raw401 + raw407 + raw414 + raw505 + raw507 + raw601 + raw603 + raw608 + raw702 + 0.5)/(raw105 + raw106 + raw107 + raw108 + raw202 + raw301 + raw303 + raw403 + raw408 + raw411 + raw412 + raw413 + raw416 + raw501 + raw502 + raw503 + raw504 + raw506 + raw602 + raw604 + raw701 + raw705 + raw706 + 0.5))

gen econ_lr = log((raw401 + raw407 + raw414 + raw505 + raw507 + raw702 + 0.5)/(raw403 + raw411 + raw412 + raw413 + raw503 + raw504 + raw506 + raw701 + 0.5))

gen social_lc = log((raw109 + raw302 + raw305 + raw601 + raw608 + 0.5)/(raw105 + raw106 + raw107 + raw201 + raw202 + raw301 + raw416 + raw501 + raw502 + raw602 + raw607 + raw704 + raw705 + raw706 + 0.5))


*The next step calculates a rescaled version of each scale that in theory approximately ranges from 0-100 (though in practice it doesn't reach either limit) 

egen gen_lr_mean = mean(gen_lr)
gen gen_lr_rescale = (gen_lr - gen_lr_mean + 7)*(100/14)

egen econ_lr_mean = mean(econ_lr)
gen econ_lr_rescale = (econ_lr - econ_lr_mean + 7)*(100/14)

egen social_lc_mean = mean(social_lc)
gen social_lc_rescale = (social_lc - social_lc_mean + 7)*(100/14)

*This step calculates the salience measure outlined in the article for each scale

*The final step deletes the variables generated in order to calculate the scale variables.

drop raw101
drop raw102
drop raw103
drop raw104
drop raw105
drop raw106
drop raw107
drop raw108
drop raw109
drop raw110
drop raw201
drop raw202
drop raw203
drop raw204
drop raw301
drop raw302
drop raw303
drop raw304
drop raw305
drop raw401
drop raw402
drop raw403
drop raw404
drop raw405
drop raw406
drop raw407
drop raw408
drop raw409
drop raw410
drop raw411
drop raw412
drop raw413
drop raw414
drop raw415
drop raw416
drop raw501
drop raw502
drop raw503
drop raw504
drop raw505
drop raw506
drop raw507
drop raw601
drop raw602
drop raw603
drop raw604
drop raw605
drop raw606
drop raw607
drop raw608
drop raw701
drop raw702
drop raw703
drop raw704
drop raw705
drop raw706

drop gen_lr_mean
drop econ_lr_mean 
drop social_lc_mean


  ************************************** Polarisation Scores - Method #1 : Taken from Dalton (2008; 2017) *************************************
  
  
* The polarization index uses the public’s mean perception of a party’s Left-Right position in each nation, weighted by the vote share for each party. Original sampling weights were used for the survey data. In some instances, we estimated party vote shares when parties ran in an electoral alliance, or when electoral returns were incomplete.

* The Polarization Index is calculated as:

*                        PI=SQRT{Σ(party vote sharei)*([party L-R scorei – party system average L-R score]/5)2} 

*                                     	(i represents individual parties).  

*                       Party vote share is calculated as a percentage for parties represented in CSES data. 
*                       Party system average L-R score is weighted by size of each party – i.e. 

*                                              Σ[(party vote sharei*party L-R scorei)/Σ(party vote sharei)]

*                       Where the sum of party vote share falls short of 100 percent in some elections. 
*                       The division by 5 is an arbitrary adjustment to center the index on the 0-10 scale. 
*                       The resulting index has a range from 0 when all parties are located at the same position on the Left-Right scale to 10 when all parties are located at the extreme positions on the CSES Left-Right scale. 




  * Data Prep *
  drop if type !=1
  bysort country edate: gen ranked = _N  
  label variable ranked "Total number of parties ranked by country_election"

  * Step 1: Rescale to 0-10 *
  
  gen GENpartyscore_PROSSER = gen_lr_rescale/10
  gen ECONpartyscore_PROSSER = econ_lr_rescale/10
  gen SOCpartyscore_PROSSER = social_lc_rescale/10
  
  gen rile_rescale = (((10 - 0)/(100 - -100)) * (rile - 100)) + 10
  
  order edate party type pervote GENpartyscore_PROSSER ECONpartyscore_PROSSER SOCpartyscore_PROSSER ranked, after(country)
  
  label variable GENpartyscore_PROSSER "General L-R CMP Policy Dimension from Prosser (2014). Rescaled so 0 = Most LW; 10 = Most RW"
  label variable ECONpartyscore_PROSSER "Economic L-R CMP Policy Dimension from Prosser (2014). Rescaled so 0 = Most LW; 10 = Most RW"
  label variable SOCpartyscore_PROSSER "Social L-R CMP Policy Dimension from Prosser (2014). Rescaled so 0 = Most Liberal; 10 = Most Conservative"
  label variable rile_rescale "L-R Manifesto Position (RiLe Method)"
  
  * Step 2: Divide party scores by their weight (vote share) *
  
  gen GENweight_partyscore = GENpartyscore_PROSSER * pervote
  gen ECONweight_partyscore = ECONpartyscore_PROSSER * pervote
  gen SOCweight_partyscore = SOCpartyscore_PROSSER * pervote
  gen RILEweight_partyscore = rile_rescale * pervote
  
  label variable GENweight_partyscore "partyscore * vote"
  label variable ECONweight_partyscore "partyscore * vote"
  label variable SOCweight_partyscore "partyscore * vote"
  label variable rile_rescale "partyscore * vote"
  
  order GENweight ECONparty ECONweight SOCparty SOCweight, after(GENparty) 
  
  * Step 3: Divide weighted party score by the total vote percentage of all mainstream parties at that election *
  
  bysort country edate: egen PSelectionvote = total(pervote) 
  
  order PSelectionvote,after(pervote)
  label variable PSelectionvote "Total vote share of those PS parties sampled by CMP"
  
  gen ps_GENweight_partyscore = GENweight_partyscore / PSelectionvote 
  gen ps_ECONweight_partyscore = ECONweight_partyscore / PSelectionvote 
  gen ps_SOCweight_partyscore = SOCweight_partyscore / PSelectionvote 
  gen ps_RILEweight_partyscore = RILEweight_partyscore / PSelectionvote
  
  label variable ps_GENweight_partyscore   "PS GENweight_partyscore / electionvote"
  label variable ps_ECONweight_partyscore  "PS ECONweight_partyscore / electionvote"
  label variable ps_SOCweight_partyscore   "PS SOCweight_partyscore / electionvote"
  label variable ps_RILEweight_partyscore  "PS RILEweight_partyscore / electionvote"
  
  order GENweight ps_GENweight ECONparty ECONweight ps_ECONweight SOCparty SOCweight ps_SOCweight, after(GENparty) 
  
  * Step 4: Deduct the sum of weighted partyscores(2) from each party's original rawscore"
  
   bysort country edate: egen ps_GENweight_TOTAL = total(ps_GENweight_partyscore) 
   bysort country edate: egen ps_ECONweight_TOTAL = total(ps_ECONweight_partyscore)
   bysort country edate: egen ps_SOCweight_TOTAL = total(ps_SOCweight_partyscore) 
   bysort country edate: egen ps_RILEweight_TOTAL = total(ps_RILEweight_partyscore) 

   bysort country edate: gen ps_GEN_distance = GENpartyscore_PROSSER - ps_GENweight_TOTAL  
   bysort country edate: gen ps_ECON_distance = ECONpartyscore_PROSSER - ps_ECONweight_TOTAL 
   bysort country edate: gen ps_SOC_distance = SOCpartyscore_PROSSER - ps_SOCweight_TOTAL
   bysort country edate: gen ps_RILE_distance = rile_rescale - ps_RILEweight_TOTAL
   
   label variable ps_GEN_distance "PS General L-R score minus weighted party system average"
   label variable ps_ECON_distance "PS Economic L-R score minus weighted party system average"
   label variable ps_SOC_distance "PS Social L-R score minus weighted party system average"

   order GENweight ps_GENweight_party ps_GENweight_TOTAL ps_GEN_distance ECONparty ECONweight_party ps_ECONweight_party ps_ECONweight_TOTAL ps_ECON_distance SOCparty SOCweight_party ps_SOCweight_party ps_SOCweight_TOTAL ps_SOC_distance, after(GENparty) 
    
   
   * Step 5: Square the centred distance scores *
    
   gen centred_psGEN_distance = (ps_GEN_distance / 5)^2
   gen centred_psECON_distance = (ps_ECON_distance / 5)^2 
   gen centred_psSOC_distance = (ps_SOC_distance / 5)^2
   gen centred_psRILE_distance = (ps_RILE_distance / 5)^2
   
   label variable centred_psGEN "Squared Centred PS Gen Distance"
   label variable centred_psECON "Squared Centred PS Econ Distance"
   label variable centred_psSOC "Squared Centred PS Soc Distance"
   label variable centred_psRILE "Squared Centred PS Rile Distance"
   
   order centred_psGEN, after(ps_GEN_distance)
   order centred_psECON, after(ps_ECON_distance)
   order centred_psSOC, after(ps_SOC_distance)
   order centred_psRILE, after(ps_RILE_distance)
   
   * Step 6: Weight CDS by vote *
   
   gen weighted_psGEN_SCDC = (centred_psGEN * pervote) / PSelectionvote
   gen weighted_psECON_SCDC = (centred_psECON * pervote) / PSelectionvote
   gen weighted_psSOC_SCDC = (centred_psSOC * pervote) / PSelectionvote
   gen weighted_psRILE_SCDC = (centred_psRILE * pervote) / PSelectionvote
     
   label variable weighted_psGEN "Weighted Squared Centred Gen Distance"
   label variable weighted_psECON "Weighted Squared Centred Econ Distance"
   label variable weighted_psSOC "Weighted Squared Centred Soc Distance"   
   label variable weighted_psRILE "Weighted Squared Centred RILE Distance"   
     
   order weighted_psGEN_SCDC, after(centred_psGEN)
   order weighted_psECON_SCDC, after(centred_psECON)
   order weighted_psSOC_SCDC, after(centred_psSOC)
   
   
   * Step 7: Create Polarisation Index by Summing Weighted CDS scores and then square rooting that sum *
   
   bysort country edate: egen rawpsGEN_Polarisation_DALTON = total(weighted_psGEN) 
   bysort country edate: egen rawpsECON_Polarisation_DALTON = total(weighted_psECON)
   bysort country edate: egen rawpsSOC_Polarisation_DALTON = total(weighted_psSOC) 
   bysort country edate: egen rawpsRILE_Polarisation = total(weighted_psRILE) 
   
   gen psGEN_Polarisation_DALTON = sqrt(rawpsGEN_Polarisation_DALTON) 
   gen psECON_Polarisation_DALTON = sqrt(rawpsECON_Polarisation_DALTON) 
   gen psSOC_Polarisation_DALTON = sqrt(rawpsSOC_Polarisation_DALTON) 
   gen psRILE_Polarisation = sqrt(rawpsRILE_Polarisation) 
   
   order rawpsGEN_Polarisation_DALTON psGEN_Polarisation_DALTON, after(weighted_psGEN)
   order rawpsECON_Polarisation_DALTON psECON_Polarisation_DALTON, after(weighted_psECON)
   order rawpsSOC_Polarisation_DALTON psSOC_Polarisation_DALTON, after(weighted_psSOC)
   
   label variable psGEN_Polarisation_DALTON "General Pro-System Polarisation Score for Given National Election, ranging from 0 (no polarisation) to 10 (full polarisation)"
   label variable psECON_Polarisation_DALTON "Economic Pro-System Polarisation Score for Given National Election, ranging from 0 (no polarisation) to 10 (full polarisation)"
   label variable psSOC_Polarisation_DALTON "Social Pro-System Polarisation Score for Given National Election, ranging from 0 (no polarisation) to 10 (full polarisation)"
   
   ************************************* SIMPLE POLARISATION MEASURE: RANGE **********************************************

 bysort country edate type (pervote): gen count = _n
 bysort country edate type (pervote): gen countZ = _N

 drop if type != 1
 drop if yr < 1950 
 
 **** 1: Range between leftmost and rightmost mainstream parties ****

 bysort country edate type (gen_lr_rescale): gen ps_size = _n

 gen small_large = 1 if ps_size == 1 | ps_size == 2 & countZ == 2 | ps_size == 3 & countZ == 3 | ps_size == 4 & countZ == 4 | ps_size == 5 & countZ == 5 | ps_size == 6 & countZ == 6 | ps_size == 7 & countZ == 7 | ps_size == 8 & countZ == 8 | ps_size == 9 & countZ == 9
 
 bysort country edate type (small_large): gen ps_diverge = gen_lr_res - gen_lr_res[_n-1] if small_large == 1
 gen ms_maxrange = (sqrt(ps_diverge^2))/10
 
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-1] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-2] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-3] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-4] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-5] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-6] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-7] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n+1] if ms_maxrange == .
 
  **** 2: Range between two largest mainstream parties **** 
 
 drop if countZ == 3 & count == 1
 drop if countZ == 4 & inrange(count,1,2)
 drop if countZ == 5 & inrange(count,1,3)
 drop if countZ == 6 & inrange(count,1,4)
 drop if countZ == 7 & inrange(count,1,5)
 drop if countZ == 8 & inrange(count,1,6)
 
 bysort country edate type (pervote): gen countZ_check = _N
 bysort country edate type (pervote): gen totvot = pervote + pervote[_n-1] 
 bysort country edate type (pervote): gen diverge = gen_lr_res - gen_lr_res[_n-1] 
 gen ms_bigrange = (sqrt(diverge^2))/10
 
   * Just keep imported variables *
  
 keep country edate party type psGEN_Polarisation_DALTON psECON_Polarisation_DALTON psSOC_Polarisation_DALTON ms_bigrange ms_maxrange psRILE_Polarisation

   
   
   * Label Data to Import *
   
collapse psGEN_Polarisation_DALTON psECON_Polarisation_DALTON psSOC_Polarisation_DALTON ms_bigrange ms_maxrange psRILE_Polarisation, by(country edate) 

   sort country edate
   gen counter = _n

   gen master_id =.
   order counter master_id, after(edate)
  
  
replace master_id = 1   if counter == 330  //* AUSTRALIA
replace master_id = 2   if counter == 331
replace master_id = 3   if counter == 332
replace master_id = 4   if counter == 333 
replace master_id = 5   if counter == 334
replace master_id = 6   if counter == 335
replace master_id = 7   if counter == 336
replace master_id = 8   if counter == 337
replace master_id = 9   if counter == 338
replace master_id = 10  if counter == 339
replace master_id = 11  if counter == 340
replace master_id = 12  if counter == 341
replace master_id = 13  if counter == 342
replace master_id = 14  if counter == 343
replace master_id = 15  if counter == 344
replace master_id = 16  if counter == 345
replace master_id = 17  if counter == 346
replace master_id = 18  if counter == 347
replace master_id = 19  if counter == 348
replace master_id = 20  if counter == 349
replace master_id = 21  if counter == 350
replace master_id = 22  if counter == 351
replace master_id = 23  if counter == 352
replace master_id = 24  if counter == 353
replace master_id = 25  if counter == 354
replace master_id = 26  if counter == 355

replace master_id = 27  if counter == 232  //* AUSTRIA
replace master_id = 28  if counter == 233
replace master_id = 29  if counter == 234
replace master_id = 30  if counter == 235
replace master_id = 31  if counter == 236
replace master_id = 32  if counter == 237
replace master_id = 33  if counter == 238
replace master_id = 34  if counter == 239
replace master_id = 35  if counter == 240
replace master_id = 36  if counter == 241
replace master_id = 37  if counter == 242
replace master_id = 38  if counter == 243
replace master_id = 39  if counter == 244
replace master_id = 40  if counter == 245
replace master_id = 41  if counter == 246
replace master_id = 42  if counter == 247
replace master_id = 43  if counter == 248
replace master_id = 44  if counter == 249
replace master_id = 45  if counter == 250

replace master_id = 46  if counter == 309 //*  CANADA
replace master_id = 47  if counter == 310
replace master_id = 48  if counter == 311
replace master_id = 49  if counter == 312
replace master_id = 50  if counter == 313
replace master_id = 51  if counter == 314
replace master_id = 52  if counter == 315
replace master_id = 53  if counter == 316
replace master_id = 54  if counter == 317
replace master_id = 55  if counter == 318
replace master_id = 56  if counter == 319
replace master_id = 57  if counter == 320
replace master_id = 58  if counter == 321
replace master_id = 59  if counter == 322
replace master_id = 60  if counter == 323
replace master_id = 61  if counter == 324
replace master_id = 62  if counter == 325
replace master_id = 63  if counter == 326
replace master_id = 64  if counter == 327
replace master_id = 65  if counter == 328
replace master_id = 66  if counter == 329
						
replace master_id = 67  if counter == 38 //* DENMARK 
replace master_id = 68  if counter == 39
replace master_id = 69  if counter == 40
replace master_id = 70 if counter == 41
replace master_id = 71 if counter == 42
replace master_id = 72 if counter == 43
replace master_id = 73 if counter == 44
replace master_id = 74 if counter == 45
replace master_id = 75 if counter == 46
replace master_id = 76 if counter == 47
replace master_id = 77 if counter == 48
replace master_id = 78 if counter == 49
replace master_id = 79 if counter == 50
replace master_id = 80 if counter == 51
replace master_id = 81 if counter == 52
replace master_id = 82 if counter == 53
replace master_id = 83 if counter == 54
replace master_id = 84 if counter == 55
replace master_id = 85 if counter == 56
replace master_id = 86 if counter == 57
replace master_id = 87 if counter == 58					
replace master_id = 88 if counter == 59
replace master_id = 89 if counter == 60
replace master_id = 90 if counter == 61 
											
replace master_id = 92 if counter == 62 //* FINLAND
replace master_id = 93 if counter == 63
replace master_id = 94 if counter == 64
replace master_id = 95 if counter == 65
replace master_id = 96 if counter == 66
replace master_id = 97 if counter == 67
replace master_id = 98 if counter == 68
replace master_id = 99 if counter == 69
replace master_id = 100 if counter == 70
replace master_id = 101 if counter == 71
replace master_id = 102 if counter == 72
replace master_id = 103 if counter == 73
replace master_id = 104 if counter == 74
replace master_id = 105 if counter == 75
replace master_id = 106 if counter == 76
replace master_id = 107 if counter == 77
replace master_id = 108 if counter == 78

replace master_id = 110 if counter == 138 //* FRANCE
replace master_id = 111 if counter == 139
replace master_id = 112 if counter == 140
replace master_id = 113 if counter == 141
replace master_id = 114 if counter == 142
replace master_id = 115 if counter == 143
replace master_id = 116 if counter == 144
replace master_id = 117 if counter == 145
replace master_id = 118 if counter == 146
replace master_id = 119 if counter == 147
replace master_id = 120 if counter == 148
replace master_id = 121 if counter == 149
replace master_id = 122 if counter == 150
replace master_id = 123 if counter == 151
replace master_id = 124 if counter == 152
replace master_id = 125 if counter == 153

replace master_id = 126 if counter == 214 //* GERMANY
replace master_id = 127 if counter == 215
replace master_id = 128 if counter == 216
replace master_id = 129 if counter == 217
replace master_id = 130 if counter == 218
replace master_id = 131 if counter == 219
replace master_id = 132 if counter == 220
replace master_id = 133 if counter == 221
replace master_id = 134 if counter == 222
replace master_id = 135 if counter == 223 
replace master_id = 136 if counter == 224
replace master_id = 137 if counter == 225
replace master_id = 138 if counter == 226
replace master_id = 139 if counter == 227
replace master_id = 140 if counter == 228
replace master_id = 141 if counter == 229
replace master_id = 142 if counter == 230

replace master_id = 143 if counter == 184 //* GREECE
replace master_id = 144 if counter == 185
replace master_id = 145 if counter == 186
replace master_id = 146 if counter == 187
replace master_id = 147 if counter == 188
replace master_id = 148 if counter == 189
replace master_id = 149 if counter == 190
replace master_id = 150 if counter == 191
replace master_id = 151 if counter == 192
replace master_id = 152 if counter == 193
replace master_id = 153 if counter == 194
replace master_id = 154 if counter == 195
replace master_id = 155 if counter == 196
replace master_id = 156 if counter == 197
replace master_id = 157 if counter == 198
replace master_id = 158 if counter == 199
replace master_id = 159 if counter == 200

replace master_id = 160 if counter == 79 //* ICELAND 
replace master_id = 161 if counter == 80
replace master_id = 162 if counter == 81
replace master_id = 163 if counter == 82
replace master_id = 164 if counter == 83
replace master_id = 165 if counter == 84
replace master_id = 166 if counter == 85
replace master_id = 167 if counter == 86
replace master_id = 168 if counter == 87
replace master_id = 169 if counter == 88
replace master_id = 170 if counter == 89
replace master_id = 171 if counter == 90
replace master_id = 172 if counter == 91
replace master_id = 173 if counter == 92
replace master_id = 174 if counter == 93
replace master_id = 175 if counter == 94
replace master_id = 176 if counter == 95
replace master_id = 177 if counter == 96
replace master_id = 178 if counter == 97
replace master_id = 179 if counter == 98

replace master_id = 180 if counter == 288 //* IRELAND
replace master_id = 181 if counter == 289
replace master_id = 182 if counter == 290
replace master_id = 183 if counter == 291
replace master_id = 184 if counter == 292
replace master_id = 185 if counter == 293
replace master_id = 186 if counter == 294
replace master_id = 187 if counter == 295
replace master_id = 188 if counter == 296
replace master_id = 189 if counter == 297
replace master_id = 190 if counter == 298
replace master_id = 191 if counter == 299
replace master_id = 192 if counter == 300
replace master_id = 193 if counter == 301
replace master_id = 194 if counter == 302
replace master_id = 195 if counter == 303
replace master_id = 196 if counter == 304
replace master_id = 197 if counter == 305
replace master_id = 198 if counter == 306

replace master_id = 199 if counter == 155 //* ITALY
replace master_id = 200 if counter == 156
replace master_id = 201 if counter == 157
replace master_id = 202 if counter == 158
replace master_id = 203 if counter == 159
replace master_id = 204 if counter == 160
replace master_id = 205 if counter == 161
replace master_id = 206 if counter == 162
replace master_id = 207 if counter == 163
replace master_id = 208 if counter == 164
replace master_id = 209 if counter == 165
replace master_id = 210 if counter == 166
replace master_id = 211 if counter == 167
replace master_id = 212 if counter == 168
replace master_id = 213 if counter == 169
replace master_id = 214 if counter == 170

replace master_id = 215 if counter == 124 //* LUXEMBOURG
replace master_id = 216 if counter == 125
replace master_id = 217 if counter == 126
replace master_id = 218 if counter == 127
replace master_id = 219 if counter == 128
replace master_id = 220 if counter == 129
replace master_id = 221 if counter == 130
replace master_id = 222 if counter == 131
replace master_id = 223 if counter == 132
replace master_id = 224 if counter == 133
replace master_id = 225 if counter == 134
replace master_id = 226 if counter == 135
replace master_id = 227 if counter == 136
replace master_id = 228 if counter == 137

replace master_id = 235 if counter == 307 //* MALTA
replace master_id = 236 if counter == 308

replace master_id = 240 if counter == 104 //* NETHERLANDS 
replace master_id = 241 if counter == 105
replace master_id = 242 if counter == 106
replace master_id = 243 if counter == 107
replace master_id = 244 if counter == 108
replace master_id = 245 if counter == 109
replace master_id = 246 if counter == 110
replace master_id = 247 if counter == 111
replace master_id = 248 if counter == 112
replace master_id = 249 if counter == 113
replace master_id = 250 if counter == 114
replace master_id = 251 if counter == 115
replace master_id = 252 if counter == 116
replace master_id = 253 if counter == 117
replace master_id = 254 if counter == 118
replace master_id = 255 if counter == 119
replace master_id = 256 if counter == 120
replace master_id = 257 if counter == 121
replace master_id = 258 if counter == 122

replace master_id = 259 if counter == 356 //* NEW ZEALAND
replace master_id = 260 if counter == 357
replace master_id = 261 if counter == 358
replace master_id = 262 if counter == 359
replace master_id = 263 if counter == 360
replace master_id = 264 if counter == 361
replace master_id = 265 if counter == 362
replace master_id = 266 if counter == 363
replace master_id = 267 if counter == 364
replace master_id = 268 if counter == 365
replace master_id = 269 if counter == 366
replace master_id = 270 if counter == 367
replace master_id = 271 if counter == 368
replace master_id = 272 if counter == 369
replace master_id = 273 if counter == 370
replace master_id = 274 if counter == 371
replace master_id = 275 if counter == 372
replace master_id = 276 if counter == 373
replace master_id = 277 if counter == 374
replace master_id = 278 if counter == 375
replace master_id = 279 if counter == 376			
replace master_id = 280 if counter == 377

replace master_id = 281 if counter == 22 //* NORWAY
replace master_id = 282 if counter == 23
replace master_id = 283 if counter == 24
replace master_id = 284 if counter == 25
replace master_id = 285 if counter == 26
replace master_id = 286 if counter == 27
replace master_id = 287 if counter == 28
replace master_id = 288 if counter == 29
replace master_id = 289 if counter == 30
replace master_id = 290 if counter == 31
replace master_id = 291 if counter == 32
replace master_id = 292 if counter == 33
replace master_id = 293 if counter == 34
replace master_id = 294 if counter == 35
replace master_id = 295 if counter == 36
replace master_id = 296 if counter == 37

replace master_id = 298 if counter == 201 //* PORTUGAL
replace master_id = 299 if counter == 202
replace master_id = 300 if counter == 203
replace master_id = 301 if counter == 204
replace master_id = 302 if counter == 205
replace master_id = 303 if counter == 206
replace master_id = 304 if counter == 207
replace master_id = 305 if counter == 208
replace master_id = 306 if counter == 209
replace master_id = 307 if counter == 210
replace master_id = 308 if counter == 211
replace master_id = 309 if counter == 212
replace master_id = 310 if counter == 213

replace master_id = 312 if counter == 172 //* SPAIN 
replace master_id = 313 if counter == 173
replace master_id = 314 if counter == 174
replace master_id = 315 if counter == 175
replace master_id = 316 if counter == 176
replace master_id = 317 if counter == 177
replace master_id = 318 if counter == 178
replace master_id = 319 if counter == 179
replace master_id = 320 if counter == 180
replace master_id = 321 if counter == 181
replace master_id = 322 if counter == 182
replace master_id = 323 if counter == 183


replace master_id = 324 if counter == 1 //* SWEDEN
replace master_id = 325 if counter == 2
replace master_id = 326 if counter == 3
replace master_id = 327 if counter == 4
replace master_id = 328 if counter == 5
replace master_id = 329 if counter == 6
replace master_id = 330 if counter == 7
replace master_id = 331 if counter == 8
replace master_id = 332 if counter == 9
replace master_id = 333 if counter == 10
replace master_id = 334 if counter == 11
replace master_id = 335 if counter == 12
replace master_id = 336 if counter == 13
replace master_id = 337 if counter == 14
replace master_id = 338 if counter == 15
replace master_id = 339 if counter == 16
replace master_id = 340 if counter == 17
replace master_id = 341 if counter == 18
replace master_id = 342 if counter == 19
replace master_id = 343 if counter == 20

replace master_id = 344 if counter == 252 //* SWIZERLAND
replace master_id = 345 if counter == 253
replace master_id = 346 if counter == 254
replace master_id = 347 if counter == 255
replace master_id = 348 if counter == 256
replace master_id = 349 if counter == 257
replace master_id = 350 if counter == 258
replace master_id = 351 if counter == 259
replace master_id = 352 if counter == 260
replace master_id = 353 if counter == 261
replace master_id = 354 if counter == 262
replace master_id = 355 if counter == 263
replace master_id = 356 if counter == 264
replace master_id = 357 if counter == 265
replace master_id = 358 if counter == 266
replace master_id = 359 if counter == 267
replace master_id = 360 if counter == 268

replace master_id = 361 if counter == 269 //* UK
replace master_id = 362 if counter == 270
replace master_id = 363 if counter == 271
replace master_id = 364 if counter == 272
replace master_id = 365 if counter == 273
replace master_id = 366 if counter == 274
replace master_id = 367 if counter == 275
replace master_id = 368 if counter == 276
replace master_id = 369 if counter == 277
replace master_id = 370 if counter == 278
replace master_id = 371 if counter == 279
replace master_id = 372 if counter == 280
replace master_id = 373 if counter == 281
replace master_id = 374 if counter == 282
replace master_id = 375 if counter == 283
replace master_id = 376 if counter == 284
replace master_id = 377 if counter == 285
replace master_id = 378 if counter == 286

drop if master_id ==.

save "$data1\rawCMP", replace
clear


 * Note: Treating Belgium separately to split Wallonia and Flanders into two separate party systems. Recoded vote share as a proportion of each respective region.
 
 
 *** WALLONIA ***
 
 use "$data1\MPDataset_MPDS2019a_stata14" // Manifesto Project 2019a Edition (Downloaded: 05/11/19)

 keep if country == 21
 
  gen yr = yofd(edate)
  order yr, after(edate)

   gen type =.
   label variable type "Relation to the System"
   label define type 1 "Mainstream" 2 "Complementary Party" 3 "Half-Way House" 4 "Anti-System" 
   label values type type
 
 order type, after(party)
 
  replace type = 4 if party == 21111 & yr  < 1995  //* ECOLO (Wallonia Greens)
  replace type = 2 if party == 21111 & inrange(yr,1995,1999)
  replace type = 1 if party == 21111 & yr >= 2003
 
  replace type = 4 if party == 21112 & yr  < 1995 //* AGALEV (Flemish Greens)
  replace type = 2 if party == 21112 & inrange(yr,1995,1999)
  replace type = 1 if party == 21112 & yr >= 2003

  replace type = 1 if party == 21320 //* Belgian Socialist Party
 
  replace type = 1 if party == 21321 //* Socialist Party Flanders
  replace type = 1 if party == 21221 & inrange(yr,2003,2007) //* Socialist Party (Flanders)
 
  replace type = 1 if party == 21322 //* Socialist Party Wallonia
 
  replace type = 1 if party == 21520 //* Christian Democratic Party of Belgium
 
  replace type = 1 if party == 21522 //* Christian Social Party (Wallonia)
  replace type = 1 if party == 21330 //* SPIRIT / CVV (2007)

  replace type = 1 if party == 21521 //* Christian People's Party (Flanders)
 
  replace type = 1 if party == 21420 //* Liberal Party of Belgium 
  
  replace type = 1 if party == 21421 //* Liberal Party of Flanders
 
  replace type = 1 if party == 21422 //* Liberal Party of Wallonia
  replace type = 1 if party == 21423 //* Liberal Reform Party - Francophone Federation Cartel (1995)
  replace type = 1 if party == 21425 //* Liberal Reform Party - FDF Alliance (1999)
  replace type = 1 if party == 21426 //* Liberal Reform Movement (Wallonia)
 
  replace type = 1 if party == 21424 //* Liberal Party of Brussels
 
  replace type = 4 if party == 21430 //* Dedecker List 
 
  replace type = 4 if party == 21230 //* Worker's Party of Belgium
 
  replace type = 4 if party == 21911 & yr < 1975 //* Walloon Rally
  replace type = 1 if party == 21911 & yr > 1975
 
  replace type = 2 if party == 21912 & yr <= 1977 //* Federal Democratic Front (FDF)
  replace type = 1 if party == 21912 & yr >= 1978
 
  replace type = 4 if party == 21913 & yr <= 1977 //*  People's Union / Flemish Christian Union 
  replace type = 1 if party == 21913 & yr >= 1978
  replace type = 1 if party == 21915 //* People's Union - 21st Century Democracy Cartel (1999)
 
  replace type = 4 if party == 21914 //* Flemish Block    (1978 - 2003)
  replace type = 4 if party == 21917 //* Flemish Interest (2007 -)

  replace type = 4 if party == 21916 & yr <= 2003 //* New Flemish Alliance
  replace type = 3 if party == 21916 & yr >  2004
  
  drop if type != 1
  
* Recode Vote Shares (Wallonia)

gen voteper =. 
order voteper, before(pervote)

*1950
replace voteper = 34.1 if party == 21520  & date == 195006
replace voteper = 44.4 if party == 21320  & date == 195006
replace voteper = 13.7 if party == 21420  & date == 195006

*1954
replace voteper = 30.9 if party == 21520  & date == 195404
replace voteper = 50.4 if party == 21320  & date == 195404
replace voteper = 11.3 if party == 21420  & date == 195404

*1958
replace voteper = 35.0 if party == 21520  & date == 195806
replace voteper = 45.4 if party == 21320  & date == 195806
replace voteper = 13.6 if party == 21420  & date == 195806

*1961
replace voteper = 31.2 if party == 21520  & date == 196103
replace voteper = 46.3 if party == 21320  & date == 196103
replace voteper = 11.7 if party == 21420  & date == 196103

*1965
replace voteper = 24.8 if party == 21520  & date == 196505
replace voteper = 35.2 if party == 21320  & date == 196505
replace voteper = 24.9 if party == 21420  & date == 196505

*1968
replace voteper = 21.5 if party == 21522  & date == 196803
replace voteper = 35.0 if party == 21320  & date == 196803
replace voteper = 26.2 if party == 21420  & date == 196803
replace voteper =  9.8 if party == 21911  & date == 196803

*1971
replace voteper = 20.9 if party == 21522  & date == 197111
replace voteper = 35.1 if party == 21320  & date == 197111
replace voteper = 17.6 if party == 21422  & date == 197111
replace voteper = 19.6 if party == 21911  & date == 197111

*1974
replace voteper = 22.8 if party == 21522  & date == 197403
replace voteper = 37.4 if party == 21320  & date == 197403
replace voteper = 19.7 if party == 21422  & date == 197403
replace voteper = 11.4 if party == 21911  & date == 197403

*1977
replace voteper = 26.0 if party == 21522  & date == 197704
replace voteper = 40.2 if party == 21320  & date == 197704
replace voteper = 18.8 if party == 21422  & date == 197704
replace voteper =  8.4 if party == 21911  & date == 197704

*1978
replace voteper = 27.1 if party == 21522  & date == 197812
replace voteper = 37.8 if party == 21322  & date == 197812
replace voteper = 16.7 if party == 21422  & date == 197812
replace voteper =  8.6 if party == 21911  & date == 197812

*1981
replace voteper = 20.2 if party == 21522  & date == 198111
replace voteper = 37.2 if party == 21322  & date == 198111
replace voteper = 21.2 if party == 21422  & date == 198111
replace voteper =  5.3 if party == 21912  & date == 198111
replace voteper =  1.8 if party == 21911  & date == 198111
replace voteper =  6.0 if party == 21111  & date == 198111

*1985
replace voteper = 23.1 if party == 21522  & date == 198510
replace voteper = 40.6 if party == 21322  & date == 198510
replace voteper = 23.4 if party == 21422  & date == 198510
replace voteper =  6.2 if party == 21111  & date == 198510

*1987
replace voteper = 23.1 if party == 21522  & date == 198712
replace voteper = 40.5 if party == 21322  & date == 198712
replace voteper = 23.4 if party == 21422  & date == 198712
replace voteper =  6.2 if party == 21111  & date == 198712

*1991
replace voteper = 22.5 if party == 21522  & date == 199111
replace voteper = 39.2 if party == 21322  & date == 199111
replace voteper = 19.8 if party == 21422  & date == 199111
replace voteper = 13.5 if party == 21111  & date == 199111
replace voteper =  1.0 if party == 21912  & date == 199111

*1995
replace voteper = 22.5 if party == 21522  & date == 199505
replace voteper = 33.7 if party == 21322  & date == 199505
replace voteper = 23.9 if party == 21423  & date == 199505
replace voteper = 10.3 if party == 21111  & date == 199505

*1999
replace voteper = 16.8 if party == 21522  & date == 199906
replace voteper = 29.2 if party == 21322  & date == 199906
replace voteper = 24.7 if party == 21425  & date == 199906
replace voteper = 18.3 if party == 21111  & date == 199906

*2003
replace voteper = 15.4 if party == 21522  & date == 200305
replace voteper = 36.4 if party == 21322  & date == 200305
replace voteper = 28.4 if party == 21426  & date == 200305
replace voteper =  7.5 if party == 21111  & date == 200305

*2007
replace voteper = 16.2 if party == 21522  & date == 200706
replace voteper = 29.5 if party == 21322  & date == 200706
replace voteper = 31.2 if party == 21426  & date == 200706
replace voteper = 12.8 if party == 21111  & date == 200706

*2010
replace voteper = 14.6 if party == 21522  & date == 201006
replace voteper = 37.6 if party == 21322  & date == 201006
replace voteper = 22.2 if party == 21426  & date == 201006
replace voteper = 12.3 if party == 21111  & date == 201006
 
*2014
replace voteper = 14.0 if party == 21522  & date == 201405 //* Humanist Democratic Centre
replace voteper = 32.0 if party == 21322  & date == 201405 //* Francophone Socialists
replace voteper = 25.8 if party == 21426  & date == 201405 //* Reform Party
replace voteper =  8.2 if party == 21111  & date == 201405 //* Greens
 
 
   * Data Prep *
  
  drop if voteper ==.
  bysort country edate: gen ranked = _N  
  label variable ranked "Total number of parties ranked by country_election"
  
  
   * Party Position Generators (from Prosser 2014)
 
gen raw101 = (per101/100)*total
gen raw102 = (per102/100)*total
gen raw103 = (per103/100)*total
gen raw104 = (per104/100)*total
gen raw105 = (per105/100)*total
gen raw106 = (per106/100)*total
gen raw107 = (per107/100)*total
gen raw108 = (per108/100)*total
gen raw109 = (per109/100)*total
gen raw110 = (per110/100)*total
gen raw201 = (per201/100)*total
gen raw202 = (per202/100)*total
gen raw203 = (per203/100)*total
gen raw204 = (per204/100)*total
gen raw301 = (per301/100)*total
gen raw302 = (per302/100)*total
gen raw303 = (per303/100)*total
gen raw304 = (per304/100)*total
gen raw305 = (per305/100)*total
gen raw401 = (per401/100)*total
gen raw402 = (per402/100)*total
gen raw403 = (per403/100)*total
gen raw404 = (per404/100)*total
gen raw405 = (per405/100)*total
gen raw406 = (per406/100)*total
gen raw407 = (per407/100)*total
gen raw408 = (per408/100)*total
gen raw409 = (per409/100)*total
gen raw410 = (per410/100)*total
gen raw411 = (per411/100)*total
gen raw412 = (per412/100)*total
gen raw413 = (per413/100)*total
gen raw414 = (per414/100)*total
gen raw415 = (per415/100)*total
gen raw416 = (per416/100)*total
gen raw501 = (per501/100)*total
gen raw502 = (per502/100)*total
gen raw503 = (per503/100)*total
gen raw504 = (per504/100)*total
gen raw505 = (per505/100)*total
gen raw506 = (per506/100)*total
gen raw507 = (per507/100)*total
gen raw601 = (per601/100)*total
gen raw602 = (per602/100)*total
gen raw603 = (per603/100)*total
gen raw604 = (per604/100)*total
gen raw605 = (per605/100)*total
gen raw606 = (per606/100)*total
gen raw607 = (per607/100)*total
gen raw608 = (per608/100)*total
gen raw701 = (per701/100)*total
gen raw702 = (per702/100)*total
gen raw703 = (per703/100)*total
gen raw704 = (per704/100)*total
gen raw705 = (per705/100)*total
gen raw706 = (per706/100)*total

*The second stage calculates the three scale variables
*gen_lr is the one dimensional general left-right scale
*econ_lr is the economic left-right scale from the two dimensional scale set
*social_lc is the social liberal-conserative scale from the two dimensional scale set

gen gen_lr = log((raw109 + raw401 + raw407 + raw414 + raw505 + raw507 + raw601 + raw603 + raw608 + raw702 + 0.5)/(raw105 + raw106 + raw107 + raw108 + raw202 + raw301 + raw303 + raw403 + raw408 + raw411 + raw412 + raw413 + raw416 + raw501 + raw502 + raw503 + raw504 + raw506 + raw602 + raw604 + raw701 + raw705 + raw706 + 0.5))

gen econ_lr = log((raw401 + raw407 + raw414 + raw505 + raw507 + raw702 + 0.5)/(raw403 + raw411 + raw412 + raw413 + raw503 + raw504 + raw506 + raw701 + 0.5))

gen social_lc = log((raw109 + raw302 + raw305 + raw601 + raw608 + 0.5)/(raw105 + raw106 + raw107 + raw201 + raw202 + raw301 + raw416 + raw501 + raw502 + raw602 + raw607 + raw704 + raw705 + raw706 + 0.5))


*The next step calculates a rescaled version of each scale that in theory approximately ranges from 0-100 (though in practice it doesn't reach either limit) 

egen gen_lr_mean = mean(gen_lr)
gen gen_lr_rescale = (gen_lr - gen_lr_mean + 7)*(100/14)

egen econ_lr_mean = mean(econ_lr)
gen econ_lr_rescale = (econ_lr - econ_lr_mean + 7)*(100/14)

egen social_lc_mean = mean(social_lc)
gen social_lc_rescale = (social_lc - social_lc_mean + 7)*(100/14)


*This step calculates the salience measure outlined in the article for each scale



*The final step deletes the variables generated in order to calculate the scale variables.

drop raw101
drop raw102
drop raw103
drop raw104
drop raw105
drop raw106
drop raw107
drop raw108
drop raw109
drop raw110
drop raw201
drop raw202
drop raw203
drop raw204
drop raw301
drop raw302
drop raw303
drop raw304
drop raw305
drop raw401
drop raw402
drop raw403
drop raw404
drop raw405
drop raw406
drop raw407
drop raw408
drop raw409
drop raw410
drop raw411
drop raw412
drop raw413
drop raw414
drop raw415
drop raw416
drop raw501
drop raw502
drop raw503
drop raw504
drop raw505
drop raw506
drop raw507
drop raw601
drop raw602
drop raw603
drop raw604
drop raw605
drop raw606
drop raw607
drop raw608
drop raw701
drop raw702
drop raw703
drop raw704
drop raw705
drop raw706

drop gen_lr_mean
drop econ_lr_mean 
drop social_lc_mean

 ************************************** Polarisation Scores - Method #1 : Taken from Dalton (2008; 2017) *************************************
  
  
* The polarization index uses the public’s mean perception of a party’s Left-Right position in each nation, weighted by the vote share for each party. Original sampling weights were used for the survey data. In some instances, we estimated party vote shares when parties ran in an electoral alliance, or when electoral returns were incomplete.

* The Polarization Index is calculated as:

*                        PI=SQRT{Σ(party vote sharei)*([party L-R scorei – party system average L-R score]/5)2} 

*                                     	(i represents individual parties).  

*                       Party vote share is calculated as a percentage for parties represented in CSES data. 
*                       Party system average L-R score is weighted by size of each party – i.e. 

*                                              Σ[(party vote sharei*party L-R scorei)/Σ(party vote sharei)]

*                       Where the sum of party vote share falls short of 100 percent in some elections. 
*                       The division by 5 is an arbitrary adjustment to center the index on the 0-10 scale. 
*                       The resulting index has a range from 0 when all parties are located at the same position on the Left-Right scale to 10 when all parties are located at the extreme positions on the CSES Left-Right scale. 


  * Step 1: Rescale to 0-10 *
  
  gen GENpartyscore_PROSSER = gen_lr_rescale/10
  gen ECONpartyscore_PROSSER = econ_lr_rescale/10
  gen SOCpartyscore_PROSSER = social_lc_rescale/10
  
  gen rile_rescale = (((10 - 0)/(100 - -100)) * (rile - 100)) + 10
  
  
  order edate party type pervote GENpartyscore_PROSSER ECONpartyscore_PROSSER SOCpartyscore_PROSSER ranked, after(country)
  
  label variable GENpartyscore_PROSSER "General L-R CMP Policy Dimension from Prosser (2014). Rescaled so 0 = Most LW; 10 = Most RW"
  label variable ECONpartyscore_PROSSER "Economic L-R CMP Policy Dimension from Prosser (2014). Rescaled so 0 = Most LW; 10 = Most RW"
  label variable SOCpartyscore_PROSSER "Social L-R CMP Policy Dimension from Prosser (2014). Rescaled so 0 = Most Liberal; 10 = Most Conservative"
  label variable rile_rescale "L-R Manifesto Position (RiLe Method)"
  
  * Step 2: Divide party scores by their weight (vote share) *
  
  gen GENweight_partyscore = GENpartyscore_PROSSER * pervote
  gen ECONweight_partyscore = ECONpartyscore_PROSSER * pervote
  gen SOCweight_partyscore = SOCpartyscore_PROSSER * pervote
  gen RILEweight_partyscore = rile_rescale * pervote
  
  label variable GENweight_partyscore "partyscore * vote"
  label variable ECONweight_partyscore "partyscore * vote"
  label variable SOCweight_partyscore "partyscore * vote"
  label variable rile_rescale "partyscore * vote"
  
  order GENweight ECONparty ECONweight SOCparty SOCweight, after(GENparty) 
  
  * Step 3: Divide weighted party score by the total vote percentage of all mainstream parties at that election *
  
  bysort country edate: egen PSelectionvote = total(pervote) 
  
  order PSelectionvote,after(pervote)
  label variable PSelectionvote "Total vote share of those PS parties sampled by CMP"
  
  gen ps_GENweight_partyscore = GENweight_partyscore / PSelectionvote 
  gen ps_ECONweight_partyscore = ECONweight_partyscore / PSelectionvote 
  gen ps_SOCweight_partyscore = SOCweight_partyscore / PSelectionvote 
  gen ps_RILEweight_partyscore = RILEweight_partyscore / PSelectionvote
  
  label variable ps_GENweight_partyscore   "PS GENweight_partyscore / electionvote"
  label variable ps_ECONweight_partyscore  "PS ECONweight_partyscore / electionvote"
  label variable ps_SOCweight_partyscore   "PS SOCweight_partyscore / electionvote"
  label variable ps_RILEweight_partyscore  "PS RILEweight_partyscore / electionvote"
  
  order GENweight ps_GENweight ECONparty ECONweight ps_ECONweight SOCparty SOCweight ps_SOCweight, after(GENparty) 
  
  * Step 4: Deduct the sum of weighted partyscores(2) from each party's original rawscore"
  
   bysort country edate: egen ps_GENweight_TOTAL = total(ps_GENweight_partyscore) 
   bysort country edate: egen ps_ECONweight_TOTAL = total(ps_ECONweight_partyscore)
   bysort country edate: egen ps_SOCweight_TOTAL = total(ps_SOCweight_partyscore) 
   bysort country edate: egen ps_RILEweight_TOTAL = total(ps_RILEweight_partyscore) 

   bysort country edate: gen ps_GEN_distance = GENpartyscore_PROSSER - ps_GENweight_TOTAL  
   bysort country edate: gen ps_ECON_distance = ECONpartyscore_PROSSER - ps_ECONweight_TOTAL 
   bysort country edate: gen ps_SOC_distance = SOCpartyscore_PROSSER - ps_SOCweight_TOTAL
   bysort country edate: gen ps_RILE_distance = rile_rescale - ps_RILEweight_TOTAL
   
   label variable ps_GEN_distance "PS General L-R score minus weighted party system average"
   label variable ps_ECON_distance "PS Economic L-R score minus weighted party system average"
   label variable ps_SOC_distance "PS Social L-R score minus weighted party system average"

   order GENweight ps_GENweight_party ps_GENweight_TOTAL ps_GEN_distance ECONparty ECONweight_party ps_ECONweight_party ps_ECONweight_TOTAL ps_ECON_distance SOCparty SOCweight_party ps_SOCweight_party ps_SOCweight_TOTAL ps_SOC_distance, after(GENparty) 
    
   
   * Step 5: Square the centred distance scores *
    
   gen centred_psGEN_distance = (ps_GEN_distance / 5)^2
   gen centred_psECON_distance = (ps_ECON_distance / 5)^2 
   gen centred_psSOC_distance = (ps_SOC_distance / 5)^2
   gen centred_psRILE_distance = (ps_RILE_distance / 5) ^ 2
   
   label variable centred_psGEN "Squared Centred PS Gen Distance"
   label variable centred_psECON "Squared Centred PS Econ Distance"
   label variable centred_psSOC "Squared Centred PS Soc Distance"
   label variable centred_psRILE "Squared Centred PS Rile Distance"
   
   order centred_psGEN, after(ps_GEN_distance)
   order centred_psECON, after(ps_ECON_distance)
   order centred_psSOC, after(ps_SOC_distance)
   order centred_psRILE, after(ps_RILE_distance)
   
   * Step 6: Weight CDS by vote *
   
   gen weighted_psGEN_SCDC = (centred_psGEN * pervote) / PSelectionvote
   gen weighted_psECON_SCDC = (centred_psECON * pervote) / PSelectionvote
   gen weighted_psSOC_SCDC = (centred_psSOC * pervote) / PSelectionvote
   gen weighted_psRILE_SCDC = (centred_psRILE * pervote) / PSelectionvote
     
   label variable weighted_psGEN "Weighted Squared Centred Gen Distance"
   label variable weighted_psECON "Weighted Squared Centred Econ Distance"
   label variable weighted_psSOC "Weighted Squared Centred Soc Distance"   
   label variable weighted_psRILE "Weighted Squared Centred RILE Distance"   
     
   order weighted_psGEN_SCDC, after(centred_psGEN)
   order weighted_psECON_SCDC, after(centred_psECON)
   order weighted_psSOC_SCDC, after(centred_psSOC)
   
   
   * Step 7: Create Polarisation Index by Summing Weighted CDS scores and then square rooting that sum *
   
   bysort country edate: egen rawpsGEN_Polarisation_DALTON = total(weighted_psGEN) 
   bysort country edate: egen rawpsECON_Polarisation_DALTON = total(weighted_psECON)
   bysort country edate: egen rawpsSOC_Polarisation_DALTON = total(weighted_psSOC) 
   bysort country edate: egen rawpsRILE_Polarisation = total(weighted_psRILE) 
   
   gen psGEN_Polarisation_DALTON = sqrt(rawpsGEN_Polarisation_DALTON) 
   gen psECON_Polarisation_DALTON = sqrt(rawpsECON_Polarisation_DALTON) 
   gen psSOC_Polarisation_DALTON = sqrt(rawpsSOC_Polarisation_DALTON) 
   gen psRILE_Polarisation = sqrt(rawpsRILE_Polarisation) 
   
   order rawpsGEN_Polarisation_DALTON psGEN_Polarisation_DALTON, after(weighted_psGEN)
   order rawpsECON_Polarisation_DALTON psECON_Polarisation_DALTON, after(weighted_psECON)
   order rawpsSOC_Polarisation_DALTON psSOC_Polarisation_DALTON, after(weighted_psSOC)
   
   label variable psGEN_Polarisation_DALTON "General Pro-System Polarisation Score for Given National Election, ranging from 0 (no polarisation) to 10 (full polarisation)"
   label variable psECON_Polarisation_DALTON "Economic Pro-System Polarisation Score for Given National Election, ranging from 0 (no polarisation) to 10 (full polarisation)"
   label variable psSOC_Polarisation_DALTON "Social Pro-System Polarisation Score for Given National Election, ranging from 0 (no polarisation) to 10 (full polarisation)"

   ************************************* SIMPLE POLARISATION MEASURE: RANGE **********************************************

 bysort country edate type (pervote): gen count = _n
 bysort country edate type (pervote): gen countZ = _N

 drop if type != 1
 drop if yr < 1950 
 
 **** 1: Range between leftmost and rightmost mainstream parties ****

 bysort country edate type (gen_lr_rescale): gen ps_size = _n

 gen small_large = 1 if ps_size == 1 | ps_size == 2 & countZ == 2 | ps_size == 3 & countZ == 3 | ps_size == 4 & countZ == 4 | ps_size == 5 & countZ == 5 | ps_size == 6 & countZ == 6 | ps_size == 7 & countZ == 7 | ps_size == 8 & countZ == 8 | ps_size == 9 & countZ == 9
 
 bysort country edate type (small_large): gen ps_diverge = gen_lr_res - gen_lr_res[_n-1] if small_large == 1
 gen ms_maxrange = (sqrt(ps_diverge^2))/10
 
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-1] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-2] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-3] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-4] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-5] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-6] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-7] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n+1] if ms_maxrange == .
 
  **** 2: Range between two largest mainstream parties **** 
 
 drop if countZ == 3 & count == 1
 drop if countZ == 4 & inrange(count,1,2)
 drop if countZ == 5 & inrange(count,1,3)
 drop if countZ == 6 & inrange(count,1,4)
 drop if countZ == 7 & inrange(count,1,5)
 drop if countZ == 8 & inrange(count,1,6)
 
 bysort country edate type (pervote): gen countZ_check = _N
 bysort country edate type (pervote): gen totvot = pervote + pervote[_n-1] 
 bysort country edate type (pervote): gen diverge = gen_lr_res - gen_lr_res[_n-1] 
 gen ms_bigrange = (sqrt(diverge^2))/10
 
   * Just keep imported variables *
  
 keep country edate party type psGEN_Polarisation_DALTON psECON_Polarisation_DALTON psSOC_Polarisation_DALTON ms_maxrange ms_bigrange psRILE_Polarisation

   * Label Data to Import *
   
collapse psGEN_Polarisation_DALTON psECON_Polarisation_DALTON psSOC_Polarisation_DALTON ms_maxrange ms_bigrange psRILE_Polarisation, by(country edate)

 gen counter = _n
  
 gen master_id =.
 order counter master_id, after(edate)

 replace master_id = 399 if counter == 1
 replace master_id = 400 if counter == 2
 replace master_id = 401 if counter == 3
 replace master_id = 402 if counter == 4
 replace master_id = 403 if counter == 5
 replace master_id = 404 if counter == 6
 replace master_id = 405 if counter == 7
 replace master_id = 406 if counter == 8
 replace master_id = 407 if counter == 9
 replace master_id = 408 if counter == 10
 replace master_id = 409 if counter == 11
 replace master_id = 410 if counter == 12
 replace master_id = 411 if counter == 13
 replace master_id = 412 if counter == 14
 replace master_id = 413 if counter == 15
 replace master_id = 414 if counter == 16
 replace master_id = 415 if counter == 17
 replace master_id = 416 if counter == 18 
 replace master_id = 417 if counter == 19 


 save "$data1\Wallonia_CMP", replace
 clear
 
 
 
 **** FLANDERS ****
 
 use "$data1\MPDataset_MPDS2019a_stata14" // Manifesto Project 2019a Edition (Downloaded: 05/11/19)

 keep if country == 21
 
 gen yr = yofd(edate)
 order yr, after(edate)

 gen type =.
 label variable type "Relation to the System"
 label define type 1 "Mainstream" 2 "Complementary Party" 3 "Half-Way House" 4 "Anti-System" 
 label values type type
 
 order type, after(party)
 
  replace type = 4 if party == 21111 & yr  < 1995  //* ECOLO (Wallonia Greens)
  replace type = 2 if party == 21111 & inrange(yr,1995,1999)
  replace type = 1 if party == 21111 & yr >= 2003
 
  replace type = 4 if party == 21112 & yr  < 1995 //* AGALEV (Flemish Greens)
  replace type = 2 if party == 21112 & inrange(yr,1995,1999)
  replace type = 1 if party == 21112 & yr >= 2003

  replace type = 1 if party == 21320 //* Belgian Socialist Party
 
  replace type = 1 if party == 21321 //* Socialist Party Flanders
  replace type = 1 if party == 21221 & inrange(yr,2003,2007) //* Socialist Party (Flanders)
 
  replace type = 1 if party == 21322 //* Socialist Party Wallonia
 
  replace type = 1 if party == 21520 //* Christian Democratic Party of Belgium
 
  replace type = 1 if party == 21522 //* Christian Social Party (Wallonia)
  replace type = 1 if party == 21330 //* SPIRIT / CVV (2007)

  replace type = 1 if party == 21521 //* Christian People's Party (Flanders)
 
  replace type = 1 if party == 21420 //* Liberal Party of Belgium 
  
  replace type = 1 if party == 21421 //* Liberal Party of Flanders
 
  replace type = 1 if party == 21422 //* Liberal Party of Wallonia
  replace type = 1 if party == 21423 //* Liberal Reform Party - Francophone Federation Cartel (1995)
  replace type = 1 if party == 21425 //* Liberal Reform Party - FDF Alliance (1999)
  replace type = 1 if party == 21426 //* Liberal Reform Movement (Wallonia)
 
  replace type = 1 if party == 21424 //* Liberal Party of Brussels
 
  replace type = 4 if party == 21430 //* Dedecker List 
 
  replace type = 4 if party == 21230 //* Worker's Party of Belgium
 
  replace type = 4 if party == 21911 & yr < 1975 //* Walloon Rally
  replace type = 1 if party == 21911 & yr > 1975
 
  replace type = 2 if party == 21912 & yr <= 1977 //* Federal Democratic Front (FDF)
  replace type = 1 if party == 21912 & yr >= 1978
 
  replace type = 4 if party == 21913 & yr <= 1977 //*  People's Union / Flemish Christian Union 
  replace type = 1 if party == 21913 & yr >= 1978
  replace type = 1 if party == 21915 //* People's Union - 21st Century Democracy Cartel (1999)
 
  replace type = 4 if party == 21914 //* Flemish Block    (1978 - 2003)
  replace type = 4 if party == 21917 //* Flemish Interest (2007 -)

  replace type = 4 if party == 21916 & yr <= 2003 //* New Flemish Alliance
  replace type = 3 if party == 21916 & yr >  2004
  
  drop if type != 1
	
* Recode Vote Shares (Flanders)

gen voteper =. 
order voteper, before(pervote)

*1950
replace voteper = 54.4 if party == 21520  & date == 195006
replace voteper = 31.0 if party == 21320  & date == 195006
replace voteper = 11.4 if party == 21420  & date == 195006

*1954
replace voteper = 46.0 if party == 21520  & date == 195404
replace voteper = 34.2 if party == 21320  & date == 195404
replace voteper = 12.6 if party == 21420  & date == 195404
replace voteper =  3.3 if party == 21913  & date == 195404

*1958
replace voteper = 50.0 if party == 21520  & date == 195806
replace voteper = 33.6 if party == 21320  & date == 195806
replace voteper = 12.4 if party == 21420  & date == 195806
replace voteper =  2.8 if party == 21913  & date == 195806

*1961
replace voteper = 46.0 if party == 21520  & date == 196103
replace voteper = 32.5 if party == 21320  & date == 196103
replace voteper = 12.6 if party == 21420  & date == 196103
replace voteper =  5.0 if party == 21913  & date == 196103

*1965
replace voteper = 38.7 if party == 21520  & date == 196505
replace voteper = 25.2 if party == 21320  & date == 196505
replace voteper = 20.2 if party == 21420  & date == 196505
replace voteper =  9.6 if party == 21913  & date == 196505
replace voteper =  1.9 if party == 21912  & date == 196505

*1968
replace voteper = 36.1 if party == 21521  & date == 196803
replace voteper = 25.0 if party == 21320  & date == 196803
replace voteper = 18.6 if party == 21420  & date == 196803
replace voteper =  4.2 if party == 21912  & date == 196803
replace voteper = 14.0 if party == 21913  & date == 196803

*1971
replace voteper = 34.0 if party == 21521  & date == 197111
replace voteper = 21.2 if party == 21320  & date == 197111
replace voteper = 15.9 if party == 21421  & date == 197111
replace voteper =  7.7 if party == 21912  & date == 197111
replace voteper = 15.8 if party == 21913  & date == 197111

*1974
replace voteper = 36.5 if party == 21521  & date == 197403
replace voteper = 19.9 if party == 21320  & date == 197403
replace voteper = 14.7 if party == 21421  & date == 197403
replace voteper =  8.1 if party == 21912  & date == 197403
replace voteper = 14.4 if party == 21913  & date == 197403

*1977
replace voteper = 40.2 if party == 21521  & date == 197704
replace voteper = 22.0 if party == 21320  & date == 197704
replace voteper = 14.3 if party == 21421  & date == 197704
replace voteper =  6.6 if party == 21912  & date == 197704
replace voteper = 14.1 if party == 21913  & date == 197704

*1978
replace voteper = 39.8 if party == 21521  & date == 197812
replace voteper = 20.5 if party == 21321  & date == 197812
replace voteper = 15.1 if party == 21421  & date == 197812
replace voteper =  6.5 if party == 21912  & date == 197812
replace voteper =  9.8 if party == 21913  & date == 197812
replace voteper =  0.6 if party == 21911  & date == 197812
replace voteper =  1.9 if party == 21914  & date == 197812

*1981
replace voteper = 29.2 if party == 21521  & date == 198111
replace voteper = 20.4 if party == 21321  & date == 198111
replace voteper = 21.8 if party == 21421  & date == 198111
replace voteper =  3.9 if party == 21912  & date == 198111
replace voteper = 13.7 if party == 21913  & date == 198111
replace voteper =  4.3 if party == 21112  & date == 198111
replace voteper =  1.6 if party == 21914  & date == 198111

*1985
replace voteper = 32.8 if party == 21521  & date == 198510
replace voteper = 24.5 if party == 21321  & date == 198510
replace voteper = 17.6 if party == 21421  & date == 198510
replace voteper =  1.7 if party == 21912  & date == 198510
replace voteper = 11.3 if party == 21913  & date == 198510
replace voteper =  6.7 if party == 21112  & date == 198510
replace voteper =  2.0 if party == 21914  & date == 198510

*1987
replace voteper = 31.8 if party == 21521  & date == 198712
replace voteper = 23.7 if party == 21321  & date == 198712
replace voteper = 20.1 if party == 21421  & date == 198712
replace voteper =  1.7 if party == 21912  & date == 198712
replace voteper = 11.0 if party == 21913  & date == 198712
replace voteper =  6.5 if party == 21112  & date == 198712
replace voteper =  2.0 if party == 21914  & date == 198712

*1991
replace voteper = 26.9 if party == 21521  & date == 199111
replace voteper = 19.8 if party == 21321  & date == 199111
replace voteper = 19.1 if party == 21421  & date == 199111
replace voteper =  0.1 if party == 21912  & date == 199111
replace voteper =  9.3 if party == 21913  & date == 199111
replace voteper =  8.0 if party == 21112  & date == 199111
replace voteper = 10.4 if party == 21914  & date == 199111

*1995
replace voteper = 27.5 if party == 21521  & date == 199505
replace voteper = 20.6 if party == 21321  & date == 199505
replace voteper = 20.8 if party == 21421  & date == 199505
replace voteper =  7.3 if party == 21913  & date == 199505
replace voteper =  7.2 if party == 21112  & date == 199505
replace voteper = 12.3 if party == 21914  & date == 199505

*1999
replace voteper = 22.6 if party == 21521  & date == 199906
replace voteper = 15.6 if party == 21321  & date == 199906
replace voteper = 22.8 if party == 21421  & date == 199906
replace voteper =  8.8 if party == 21915  & date == 199906
replace voteper = 11.4 if party == 21112  & date == 199906
replace voteper = 15.4 if party == 21914  & date == 199906

*2003
replace voteper = 21.6 if party == 21521  & date == 200305
replace voteper = 24.3 if party == 21221  & date == 200305
replace voteper = 24.3 if party == 21421  & date == 200305
replace voteper =  4.9 if party == 21916  & date == 200305
replace voteper =  3.9 if party == 21112  & date == 200305
replace voteper = 18.0 if party == 21914  & date == 200305

*2007
replace voteper = 29.9 if party == 21521  & date == 200706
replace voteper = 19.1 if party == 21421  & date == 200706
replace voteper = 19.1 if party == 21917  & date == 200706
replace voteper = 17.0 if party == 21321  & date == 200706
replace voteper =  6.5 if party == 21112  & date == 200706
replace voteper =  6.6 if party == 21430  & date == 200706

*2010
replace voteper = 17.6 if party == 21521  & date == 201006
replace voteper = 15.3 if party == 21321  & date == 201006
replace voteper = 13.9 if party == 21421  & date == 201006
replace voteper =  7.1 if party == 21112  & date == 201006
replace voteper = 27.9 if party == 21916  & date == 201006
replace voteper = 12.5 if party == 21917  & date == 201006
replace voteper =  3.8 if party == 21430  & date == 201006
 
*2014
replace voteper = 15.5 if party == 21421  & date == 201405
replace voteper = 14.0 if party == 21321  & date == 201405
replace voteper =  8.6 if party == 21112  & date == 201405
replace voteper = 18.6 if party == 21521  & date == 201405

 

   * Data Prep *
  
  drop if voteper ==.
  capture bysort country edate: gen ranked = _N  
  capture label variable ranked "Total number of parties ranked by country_election"
  
  
   * Party Position Generators (from Prosser 2014)
 
gen raw101 = (per101/100)*total
gen raw102 = (per102/100)*total
gen raw103 = (per103/100)*total
gen raw104 = (per104/100)*total
gen raw105 = (per105/100)*total
gen raw106 = (per106/100)*total
gen raw107 = (per107/100)*total
gen raw108 = (per108/100)*total
gen raw109 = (per109/100)*total
gen raw110 = (per110/100)*total
gen raw201 = (per201/100)*total
gen raw202 = (per202/100)*total
gen raw203 = (per203/100)*total
gen raw204 = (per204/100)*total
gen raw301 = (per301/100)*total
gen raw302 = (per302/100)*total
gen raw303 = (per303/100)*total
gen raw304 = (per304/100)*total
gen raw305 = (per305/100)*total
gen raw401 = (per401/100)*total
gen raw402 = (per402/100)*total
gen raw403 = (per403/100)*total
gen raw404 = (per404/100)*total
gen raw405 = (per405/100)*total
gen raw406 = (per406/100)*total
gen raw407 = (per407/100)*total
gen raw408 = (per408/100)*total
gen raw409 = (per409/100)*total
gen raw410 = (per410/100)*total
gen raw411 = (per411/100)*total
gen raw412 = (per412/100)*total
gen raw413 = (per413/100)*total
gen raw414 = (per414/100)*total
gen raw415 = (per415/100)*total
gen raw416 = (per416/100)*total
gen raw501 = (per501/100)*total
gen raw502 = (per502/100)*total
gen raw503 = (per503/100)*total
gen raw504 = (per504/100)*total
gen raw505 = (per505/100)*total
gen raw506 = (per506/100)*total
gen raw507 = (per507/100)*total
gen raw601 = (per601/100)*total
gen raw602 = (per602/100)*total
gen raw603 = (per603/100)*total
gen raw604 = (per604/100)*total
gen raw605 = (per605/100)*total
gen raw606 = (per606/100)*total
gen raw607 = (per607/100)*total
gen raw608 = (per608/100)*total
gen raw701 = (per701/100)*total
gen raw702 = (per702/100)*total
gen raw703 = (per703/100)*total
gen raw704 = (per704/100)*total
gen raw705 = (per705/100)*total
gen raw706 = (per706/100)*total

*The second stage calculates the three scale variables
*gen_lr is the one dimensional general left-right scale
*econ_lr is the economic left-right scale from the two dimensional scale set
*social_lc is the social liberal-conserative scale from the two dimensional scale set

gen gen_lr = log((raw109 + raw401 + raw407 + raw414 + raw505 + raw507 + raw601 + raw603 + raw608 + raw702 + 0.5)/(raw105 + raw106 + raw107 + raw108 + raw202 + raw301 + raw303 + raw403 + raw408 + raw411 + raw412 + raw413 + raw416 + raw501 + raw502 + raw503 + raw504 + raw506 + raw602 + raw604 + raw701 + raw705 + raw706 + 0.5))

gen econ_lr = log((raw401 + raw407 + raw414 + raw505 + raw507 + raw702 + 0.5)/(raw403 + raw411 + raw412 + raw413 + raw503 + raw504 + raw506 + raw701 + 0.5))

gen social_lc = log((raw109 + raw302 + raw305 + raw601 + raw608 + 0.5)/(raw105 + raw106 + raw107 + raw201 + raw202 + raw301 + raw416 + raw501 + raw502 + raw602 + raw607 + raw704 + raw705 + raw706 + 0.5))


*The next step calculates a rescaled version of each scale that in theory approximately ranges from 0-100 (though in practice it doesn't reach either limit) 

egen gen_lr_mean = mean(gen_lr)
gen gen_lr_rescale = (gen_lr - gen_lr_mean + 7)*(100/14)

egen econ_lr_mean = mean(econ_lr)
gen econ_lr_rescale = (econ_lr - econ_lr_mean + 7)*(100/14)

egen social_lc_mean = mean(social_lc)
gen social_lc_rescale = (social_lc - social_lc_mean + 7)*(100/14)


*This step calculates the salience measure outlined in the article for each scale



*The final step deletes the variables generated in order to calculate the scale variables.

drop raw101
drop raw102
drop raw103
drop raw104
drop raw105
drop raw106
drop raw107
drop raw108
drop raw109
drop raw110
drop raw201
drop raw202
drop raw203
drop raw204
drop raw301
drop raw302
drop raw303
drop raw304
drop raw305
drop raw401
drop raw402
drop raw403
drop raw404
drop raw405
drop raw406
drop raw407
drop raw408
drop raw409
drop raw410
drop raw411
drop raw412
drop raw413
drop raw414
drop raw415
drop raw416
drop raw501
drop raw502
drop raw503
drop raw504
drop raw505
drop raw506
drop raw507
drop raw601
drop raw602
drop raw603
drop raw604
drop raw605
drop raw606
drop raw607
drop raw608
drop raw701
drop raw702
drop raw703
drop raw704
drop raw705
drop raw706

drop gen_lr_mean
drop econ_lr_mean 
drop social_lc_mean


 * Data Prep *
  drop if type !=1
  capture bysort country edate: gen ranked = _N  
  capture label variable ranked "Total number of parties ranked by country_election"

 ************************************** Polarisation Scores - Method #1 : Taken from Dalton (2008; 2017) *************************************
  
  
* The polarization index uses the public’s mean perception of a party’s Left-Right position in each nation, weighted by the vote share for each party. Original sampling weights were used for the survey data. In some instances, we estimated party vote shares when parties ran in an electoral alliance, or when electoral returns were incomplete.

* The Polarization Index is calculated as:

*                        PI=SQRT{Σ(party vote sharei)*([party L-R scorei – party system average L-R score]/5)2} 

*                                     	(i represents individual parties).  

*                       Party vote share is calculated as a percentage for parties represented in CSES data. 
*                       Party system average L-R score is weighted by size of each party – i.e. 

*                                              Σ[(party vote sharei*party L-R scorei)/Σ(party vote sharei)]

*                       Where the sum of party vote share falls short of 100 percent in some elections. 
*                       The division by 5 is an arbitrary adjustment to center the index on the 0-10 scale. 
*                       The resulting index has a range from 0 when all parties are located at the same position on the Left-Right scale to 10 when all parties are located at the extreme positions on the CSES Left-Right scale. 


  * Step 1: Rescale to 0-10 *
  
  gen GENpartyscore_PROSSER = gen_lr_rescale/10
  gen ECONpartyscore_PROSSER = econ_lr_rescale/10
  gen SOCpartyscore_PROSSER = social_lc_rescale/10
  
  gen rile_rescale = (((10 - 0)/(100 - -100)) * (rile - 100)) + 10
  
  
  order edate party type pervote GENpartyscore_PROSSER ECONpartyscore_PROSSER SOCpartyscore_PROSSER ranked, after(country)
  
  label variable GENpartyscore_PROSSER "General L-R CMP Policy Dimension from Prosser (2014). Rescaled so 0 = Most LW; 10 = Most RW"
  label variable ECONpartyscore_PROSSER "Economic L-R CMP Policy Dimension from Prosser (2014). Rescaled so 0 = Most LW; 10 = Most RW"
  label variable SOCpartyscore_PROSSER "Social L-R CMP Policy Dimension from Prosser (2014). Rescaled so 0 = Most Liberal; 10 = Most Conservative"
  label variable rile_rescale "L-R Manifesto Position (RiLe Method)"
  
  * Step 2: Divide party scores by their weight (vote share) *
  
  gen GENweight_partyscore = GENpartyscore_PROSSER * pervote
  gen ECONweight_partyscore = ECONpartyscore_PROSSER * pervote
  gen SOCweight_partyscore = SOCpartyscore_PROSSER * pervote
  gen RILEweight_partyscore = rile_rescale * pervote
  
  label variable GENweight_partyscore "partyscore * vote"
  label variable ECONweight_partyscore "partyscore * vote"
  label variable SOCweight_partyscore "partyscore * vote"
  label variable rile_rescale "partyscore * vote"
  
  order GENweight ECONparty ECONweight SOCparty SOCweight, after(GENparty) 
  
  * Step 3: Divide weighted party score by the total vote percentage of all mainstream parties at that election *
  
  bysort country edate: egen PSelectionvote = total(pervote) 
  
  order PSelectionvote,after(pervote)
  label variable PSelectionvote "Total vote share of those PS parties sampled by CMP"
  
  gen ps_GENweight_partyscore = GENweight_partyscore / PSelectionvote 
  gen ps_ECONweight_partyscore = ECONweight_partyscore / PSelectionvote 
  gen ps_SOCweight_partyscore = SOCweight_partyscore / PSelectionvote 
  gen ps_RILEweight_partyscore = RILEweight_partyscore / PSelectionvote
  
  label variable ps_GENweight_partyscore   "PS GENweight_partyscore / electionvote"
  label variable ps_ECONweight_partyscore  "PS ECONweight_partyscore / electionvote"
  label variable ps_SOCweight_partyscore   "PS SOCweight_partyscore / electionvote"
  label variable ps_RILEweight_partyscore  "PS RILEweight_partyscore / electionvote"
  
  order GENweight ps_GENweight ECONparty ECONweight ps_ECONweight SOCparty SOCweight ps_SOCweight, after(GENparty) 
  
  * Step 4: Deduct the sum of weighted partyscores(2) from each party's original rawscore"
  
   bysort country edate: egen ps_GENweight_TOTAL = total(ps_GENweight_partyscore) 
   bysort country edate: egen ps_ECONweight_TOTAL = total(ps_ECONweight_partyscore)
   bysort country edate: egen ps_SOCweight_TOTAL = total(ps_SOCweight_partyscore) 
   bysort country edate: egen ps_RILEweight_TOTAL = total(ps_RILEweight_partyscore) 

   bysort country edate: gen ps_GEN_distance = GENpartyscore_PROSSER - ps_GENweight_TOTAL  
   bysort country edate: gen ps_ECON_distance = ECONpartyscore_PROSSER - ps_ECONweight_TOTAL 
   bysort country edate: gen ps_SOC_distance = SOCpartyscore_PROSSER - ps_SOCweight_TOTAL
   bysort country edate: gen ps_RILE_distance = rile_rescale - ps_RILEweight_TOTAL
   
   label variable ps_GEN_distance "PS General L-R score minus weighted party system average"
   label variable ps_ECON_distance "PS Economic L-R score minus weighted party system average"
   label variable ps_SOC_distance "PS Social L-R score minus weighted party system average"

   order GENweight ps_GENweight_party ps_GENweight_TOTAL ps_GEN_distance ECONparty ECONweight_party ps_ECONweight_party ps_ECONweight_TOTAL ps_ECON_distance SOCparty SOCweight_party ps_SOCweight_party ps_SOCweight_TOTAL ps_SOC_distance, after(GENparty) 
    
   
   * Step 5: Square the centred distance scores *
    
   gen centred_psGEN_distance = (ps_GEN_distance / 5)^2
   gen centred_psECON_distance = (ps_ECON_distance / 5)^2 
   gen centred_psSOC_distance = (ps_SOC_distance / 5)^2
   gen centred_psRILE_distance = (ps_RILE_distance / 5) ^ 2
   
   label variable centred_psGEN "Squared Centred PS Gen Distance"
   label variable centred_psECON "Squared Centred PS Econ Distance"
   label variable centred_psSOC "Squared Centred PS Soc Distance"
   label variable centred_psRILE "Squared Centred PS Rile Distance"
   
   order centred_psGEN, after(ps_GEN_distance)
   order centred_psECON, after(ps_ECON_distance)
   order centred_psSOC, after(ps_SOC_distance)
   order centred_psRILE, after(ps_RILE_distance)
   
   * Step 6: Weight CDS by vote *
   
   gen weighted_psGEN_SCDC = (centred_psGEN * pervote) / PSelectionvote
   gen weighted_psECON_SCDC = (centred_psECON * pervote) / PSelectionvote
   gen weighted_psSOC_SCDC = (centred_psSOC * pervote) / PSelectionvote
   gen weighted_psRILE_SCDC = (centred_psRILE * pervote) / PSelectionvote
     
   label variable weighted_psGEN "Weighted Squared Centred Gen Distance"
   label variable weighted_psECON "Weighted Squared Centred Econ Distance"
   label variable weighted_psSOC "Weighted Squared Centred Soc Distance"   
   label variable weighted_psRILE "Weighted Squared Centred RILE Distance"   
     
   order weighted_psGEN_SCDC, after(centred_psGEN)
   order weighted_psECON_SCDC, after(centred_psECON)
   order weighted_psSOC_SCDC, after(centred_psSOC)
   
   
   * Step 7: Create Polarisation Index by Summing Weighted CDS scores and then square rooting that sum *
   
   bysort country edate: egen rawpsGEN_Polarisation_DALTON = total(weighted_psGEN) 
   bysort country edate: egen rawpsECON_Polarisation_DALTON = total(weighted_psECON)
   bysort country edate: egen rawpsSOC_Polarisation_DALTON = total(weighted_psSOC) 
   bysort country edate: egen rawpsRILE_Polarisation = total(weighted_psRILE) 
   
   gen psGEN_Polarisation_DALTON = sqrt(rawpsGEN_Polarisation_DALTON) 
   gen psECON_Polarisation_DALTON = sqrt(rawpsECON_Polarisation_DALTON) 
   gen psSOC_Polarisation_DALTON = sqrt(rawpsSOC_Polarisation_DALTON) 
   gen psRILE_Polarisation = sqrt(rawpsRILE_Polarisation) 
   
   order rawpsGEN_Polarisation_DALTON psGEN_Polarisation_DALTON, after(weighted_psGEN)
   order rawpsECON_Polarisation_DALTON psECON_Polarisation_DALTON, after(weighted_psECON)
   order rawpsSOC_Polarisation_DALTON psSOC_Polarisation_DALTON, after(weighted_psSOC)
   
   label variable psGEN_Polarisation_DALTON "General Pro-System Polarisation Score for Given National Election, ranging from 0 (no polarisation) to 10 (full polarisation)"
   label variable psECON_Polarisation_DALTON "Economic Pro-System Polarisation Score for Given National Election, ranging from 0 (no polarisation) to 10 (full polarisation)"
   label variable psSOC_Polarisation_DALTON "Social Pro-System Polarisation Score for Given National Election, ranging from 0 (no polarisation) to 10 (full polarisation)"

   ************************************* SIMPLE POLARISATION MEASURE: RANGE **********************************************

 bysort country edate type (pervote): gen count = _n
 bysort country edate type (pervote): gen countZ = _N

 drop if type != 1
 drop if yr < 1950 
 
 **** 1: Range between leftmost and rightmost mainstream parties ****

 bysort country edate type (gen_lr_rescale): gen ps_size = _n

 gen small_large = 1 if ps_size == 1 | ps_size == 2 & countZ == 2 | ps_size == 3 & countZ == 3 | ps_size == 4 & countZ == 4 | ps_size == 5 & countZ == 5 | ps_size == 6 & countZ == 6 | ps_size == 7 & countZ == 7 | ps_size == 8 & countZ == 8 | ps_size == 9 & countZ == 9
 
 bysort country edate type (small_large): gen ps_diverge = gen_lr_res - gen_lr_res[_n-1] if small_large == 1
 gen ms_maxrange = (sqrt(ps_diverge^2))/10
 
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-1] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-2] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-3] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-4] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-5] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-6] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n-7] if ms_maxrange == .
 bysort country edate type: replace ms_maxrange = ms_maxrange[_n+1] if ms_maxrange == .
 
  **** 2: Range between two largest mainstream parties **** 
 
 drop if countZ == 3 & count == 1
 drop if countZ == 4 & inrange(count,1,2)
 drop if countZ == 5 & inrange(count,1,3)
 drop if countZ == 6 & inrange(count,1,4)
 drop if countZ == 7 & inrange(count,1,5)
 drop if countZ == 8 & inrange(count,1,6)
 
 bysort country edate type (pervote): gen countZ_check = _N
 bysort country edate type (pervote): gen totvot = pervote + pervote[_n-1] 
 bysort country edate type (pervote): gen diverge = gen_lr_res - gen_lr_res[_n-1] 
 gen ms_bigrange = (sqrt(diverge^2))/10
 
   * Just keep imported variables *
  
 keep country edate party type psGEN_Polarisation_DALTON psECON_Polarisation_DALTON psSOC_Polarisation_DALTON ms_bigrange ms_maxrange psRILE_Polarisation

   * Label Data to Import *
   
collapse psGEN_Polarisation_DALTON psECON_Polarisation_DALTON psSOC_Polarisation_DALTON ms_bigrange ms_maxrange psRILE_Polarisation, by(country edate)

 gen counter = _n
  
 gen master_id =.
 order counter master_id, after(edate)

 replace master_id = 379 if counter == 1
 replace master_id = 380 if counter == 2
 replace master_id = 381 if counter == 3
 replace master_id = 382 if counter == 4
 replace master_id = 383 if counter == 5
 replace master_id = 384 if counter == 6
 replace master_id = 385 if counter == 7
 replace master_id = 386 if counter == 8
 replace master_id = 387 if counter == 9
 replace master_id = 388 if counter == 10
 replace master_id = 389 if counter == 11
 replace master_id = 390 if counter == 12
 replace master_id = 391 if counter == 13
 replace master_id = 392 if counter == 14
 replace master_id = 393 if counter == 15
 replace master_id = 394 if counter == 16
 replace master_id = 395 if counter == 17
 replace master_id = 396 if counter == 18 
 replace master_id = 397 if counter == 19 
 replace master_id = 398 if counter == 20

  save "$data1\Flanders_CMP", replace
  clear
 
 
***** Merge whole thing *****

use "$data1\rawCMP.dta"
merge 1:1 master_id using "$data1\Wallonia_CMP.dta", force
drop _merge
merge 1:1 master_id using "$data1\Flanders_CMP.dta", force
replace country = 3 if inrange(master_id,379,398)
replace country = 4 if inrange(master_id,399,418)

drop _merge

save "$data1\rawCMP.dta", replace

label variable psGEN_Polarisation_DALTON   "Mainstream Party GENERAL L-R Polarisation"
label variable psECON_Polarisation_DALTON  "Mainstream Party ECONOMIC L-R Polarisation"
label variable psSOC_Polarisation_DALTON   "Mainstream Party SOCIAL L-R Polarisation"
label variable psRILE_Polarisation  "Mainstream Party L-R Polarisation (RILE)"
label variable ms_bigrange  "General L-R Gap Between Two Largest Mainstream Parties (0-10)"



bysort country (edate) : gen lag_psGEN_Polarisation_DALTON =  psGEN_Polarisation_DALTON[_n -1]
bysort country (edate) : gen lag_psECON_Polarisation_DALTON =   psECON_Polarisation_DALTON[_n -1]
bysort country (edate) : gen lag_psSOC_Polarisation_DALTON  =   psSOC_Polarisation_DALTON[_n -1]

label variable lag_psGEN_Polarisation_DALTON  "Lagged General Pro-System Party System Polarisation (Dalton Formula)"
label variable lag_psECON_Polarisation_DALTON "Lagged Economic Pro-System Party System Polarisation (Dalton Formula)"
label variable lag_psSOC_Polarisation_DALTON "Lagged Social Pro-System Party System Lib-Con Polarisation (Dalton Formula)"

save "$data1\rawCMP.dta", replace
clear

use "$data1\Study1Combined.dta"

merge 1:1 master_id using "$data1\rawCMP.dta", force
drop _merge

 
 * Label Variables *
 
 drop Belg_sep counter elec_id country date elec_n country_ID country_name uptier_decisive upperseats tier2_districts country_n year half_year pop

 label variable lagged_tier1 "Tier 1 Average Electoral Magnitude, Lagged 1 Election"
 label variable lagged_tier2 "Tier 2 Average Electoral Magnitude, Lagged 1 Election"
 label variable lagged_decisive "Average Electoral Magnitude in Decisive Tier, Lagged 1 Election"
 label variable lagged_effecthresh "Effective Threshold, Lagged 1 Election"
 label variable lagged_legalthresh "Legal Threshold, Lagged 1 Election"
 label variable lagged_thresh "Electoral Threshold (Highest of Effective or Legal), Lagged 1 Election"
 label variable n_RAI "Regional Authority Index of Decentralisation, 0 = Least Decentralised; 30 = Most (Hooghe et al 2016)"
 label variable lag_RAI "Regional Authority Index of Decentralisation, Lagged 1 Election"


 replace rgdpna = rgdpna / 10000
 label variable rgdpna "Real GDP at constant 2011 national prices (in 10000 2011US$)"
 
  ** Logging Skewed Distribution Institutional Variables ** 
 
 gen log_decisive = ln(decisive)
 gen log_lagged_decisive = ln(lagged_decisive)
 gen log_n_RAI = ln(n_RAI)
 gen log_lag_RAI = ln(lag_RAI)

 replace log_n_RAI = 1 if n_RAI == 1 & log_n_RAI == .
 replace log_lag_RAI = 1 if lag_RAI == 1 & log_lag_RAI ==.
 replace log_n_RAI = 0 if n_RAI == 0 & log_n_RAI == .
 replace log_lag_RAI = 0 if lag_RAI == 0 & log_lag_RAI ==.
 replace log_decisive = 1 if log_decisive == 0
 
 order log_decisive, after(decisive)
 order log_lagged_decisive, after(lagged_decisive)
 order log_n_RAI, after(n_RAI)
 order log_lag_RAI, after(lag_RAI)
 
 label variable log_decisive "Logged Average Electoral Magnitude in Decisive Tier"
 label variable log_lagged_decisive "Logged Average Electoral Magnitude in Decisive Tier, Lagged 1 Election"
 label variable log_n_RAI "Logged Regional Authority Index of Decentralisation, 0 = Least Decentralised; 30 = Most (Hooghe et al 2016)"
 label variable log_lag_RAI "Logged Regional Authority Index of Decentralisation, Lagged 1 Election"
 
  *** Recode Polarisation Scores to Run 0-10 (10 = More Polarisation) ***
 
  gen GEN_MainstreamPolarisation = psGEN_Polarisation_DALTON * 10 
  gen ECON_MainstreamPolarisation = psECON_Polarisation_DALTON * 10
  gen SOC_MainstreamPolarisation = psSOC_Polarisation_DALTON * 10
  gen RILE_MainstreamPolarisation = psRILE_Polarisation * 10
  
  gen lag_GEN_MainstreamPolarisation = lag_psGEN_Polarisation_DALTON * 10 
  gen lag_ECON_MainstreamPolarisation = lag_psECON_Polarisation_DALTON * 10
  gen lag_SOC_MainstreamPolarisation = lag_psSOC_Polarisation_DALTON * 10
  
  label variable GEN_MainstreamPolarisation "Mainstream Party General L-R Polarisation Score for Given Election, Range: 0 (full converge) to 10 (full polar)"
  label variable ECON_MainstreamPolarisation "Mainstream Party Economic L-R Polarisation Score for Given Election, Range: 0 (full converge) to 10 (full polar)"
  label variable SOC_MainstreamPolarisation "Mainstream Party Social Lib-Con Polarisation Score for Given Election, Range: 0 (full converge) to 10 (full polar)"
  label variable RILE_MainstreamPolarisation "Mainstream Party L-R Polarisation (RILE Method)"
  
  label variable lag_GEN_MainstreamPolarisation "Lagged Mainstream Party General L-R Polarisation Score for Given Election, Range: 0 (full converge) to 10 (full polar)"
  label variable lag_ECON_MainstreamPolarisation "Lagged Mainstream Party Economic L-R Polarisation Score for Given Election, Range: 0 (full converge) to 10 (full polar)"
  label variable lag_SOC_MainstreamPolarisation "Lagged Mainstream Party Social Lib-Con Polarisation Score for Given Election, Range: 0 (full converge) to 10 (full polar)"

  gen year = real(substr(string_date, -4, 4))
  label variable year "Election year (Numeric)"
  order year, after(edate)
 
 *****************************************************************************************************************************************************************************

 *** Only keep core variables ***

rename lag2GR_rgdpnaPC lag_growth
rename decisive DM
rename log_decisive log_DM
rename lagged_decisive lag_DM
rename log_lagged_decisive loglag_DM
rename n_RAI decentralisation
rename log_n_RAI log_decentralisation
rename lag_RAI lag_decentralisation
rename log_lag_RAI loglag_decentralisation
rename lagged_thresh lag_threshold

order master_id FEcountry string_date edate year month post_auth_election string_PSparties - lag_ASP ///
voteper_EL_ASP voteper_RL_ASP voteper_ER_ASP voteper_RR_ASP voteper_GREEN_ASP voteper_PIRATE_ASP ///
voteper_MISC_POP_ASP voteper_SEC_NAT_ASP voteper_REL_ASP voteper_OTHERR_ASP voteper_OTHERL_ASP ///
GEN_MainstreamPolarisation ECON_MainstreamPolarisation SOC_MainstreamPolarisation ///
lag_GEN_MainstreamPolarisation lag_ECON_MainstreamPolarisation lag_SOC_MainstreamPolarisation ///
ms_bigrange ms_maxrange RILE_MainstreamPolarisation lag_growth log_lagGDPpc lag_rgdpnaPC PC_rgdpna openness lag_openness  ///
DM lag_DM loglag_DM threshold lag_enep lag_enpp decentralisation log_decentralisation lag_decentralisation loglag_decentralisation, after(countryelection)
 
keep countryelection master_id FEcountry string_date edate year month post_auth_election string_PSparties - lag_ASP ///
voteper_EL_ASP voteper_RL_ASP voteper_ER_ASP voteper_RR_ASP voteper_GREEN_ASP voteper_PIRATE_ASP ///
voteper_MISC_POP_ASP voteper_SEC_NAT_ASP voteper_REL_ASP voteper_OTHERR_ASP voteper_OTHERL_ASP ///
GEN_MainstreamPolarisation ECON_MainstreamPolarisation SOC_MainstreamPolarisation ///
lag_GEN_MainstreamPolarisation lag_ECON_MainstreamPolarisation lag_SOC_MainstreamPolarisation ///
ms_bigrange ms_maxrange RILE_MainstreamPolarisation lag_growth openness log_lagGDPpc lag_rgdpnaPC PC_rgdpna lag_openness  ///
DM lag_DM loglag_DM threshold lag_enep lag_enpp decentralisation log_decentralisation lag_decentralisation loglag_decentralisation


label variable ms_bigrange "L-R (General) Gap Between Largest Two Mainstream Parties (No Weighting, Prosser/CMP Data)"
label variable ms_maxrange "L-R (General) Gap Between Leftmost and Rightmost Mainstream Parties (No Weighting, Prosser/CMP Data)"

 **** COALITIONS ****
 
  *** GRAND COALITION DUMMY ***

* Definition: Two major parties of the left and right serving in government together a year prior to an election. 
*             Empirically defined as the circumstance where the two largest mainstream parties of the left and right 
*             (score above and below 5.5 on 11-point scale acc. Expert Surveys of Döring, Holger and Philip Manow. 2019. Parliaments and governments database (ParlGov):
*             Information on parties, elections and cabinets in modern democracies. Development version.


gen GroKo =.
label variable GroKo "Grand Coalition in Year Prior to an Election"

label define GroKo 1 "Grand Coalitin"  0 "No Grand Coalition"
label values GroKo GroKo

replace GroKo = 1 if inlist(master_id, 27,28,29,30,31,38,39,40,41,44,45,79, 92,97,100,103,107,109,110,112,130,141,149,156,157,158,160,168,170,171,174,177,179, ///
                                            198,202,206,207,208,209,216,217,219,223,224,225,227,228,240,241,242,244,247,252,254,257,301,344,347,348,349,350,351,352,353, ///
											354,355,356,357,358,359,360,383,385,386,388,389,392,393,394,395,396,397,398,403,405,406,408,409,412,413,414,415,416,417,418)
											
replace GroKo = 0 if GroKo != 1


************************************************************************************************************************************************************


 *** Other Variables ***


*** Generate a Year-Group Variable that will not use up all my df ***

recode year (1950/1959 = 1) (1960/1969 = 2) (1970/1979 = 3) (1980/1989 = 4) (1990/1999 = 5) (2000/2009 = 6) (2010/2016 = 7), gen(year_10)
label variable year_10 "Year (5-Year Group Dummies)"
label define year_10 1 "1950-59" 2 "1960-69" 3 "1970-79" 4 "1980-89" 5 "1990-99" 6 "2000-09" 7 "2010-19" 
label value year_10 year_10

*** Alternative Panel Id ***

bysort FEcountry (edate): gen election_n = _n //* Note: Using this as the time-id instead of edate makes no difference whatsoever. 
label variable election_n "Election Number in National Time Series"
   
*** Lag Other Variables due to Skew ***

gen log_lopen = ln(lag_openness)
gen log_openness = ln(openness)
order log_lopen, after(lag_openness)
order log_openness, after(openness)
gen log_thresh = ln(threshold)
gen log_lenep = ln(lag_enep)
label variable log_openness "Trade Openness (Logged)"
label variable log_lopen "Trade Openness, Lagged 1 Year (Logged)"
label variable log_thresh "Electoral Threshold - Effective or Legal (Logged)"
label variable log_lenep "Lagged Effective Number of Parties (Logged)"
   
   
*** Alternative DV: Recession ***

gen recession = 1 if lag_growth < 0
replace recession = 0 if lag_growth > 0	   
label variable recession "National Economy in Recession"  
   
*** Dropping Certain Observations ***
             
drop if FEcountry == 15               //* Malta has too much missing data on party positions. Lose 11 cases. 
drop if post_auth_election == 1       //* Drop immediate post-authoritarian elections. Not clear who would be the 'mainstream'/'pro-system' actors in these cases. Lose 5 elections.
drop election_n
	 
*******************************************************************************************************************************************************************************************************************************

*** Generate Alternative DVs ***

gen voteper_ALLRAD =  voteper_ASparties + voteper_SCparties
label variable voteper_ALLRAD "Combined Vote Share for All Anti-System and System-Critical Parties"

gen voteper_ALLOUT =  voteper_ASparties + voteper_CPparties
label variable voteper_ALLOUT "Combined Vote Share for All Anti-System and Complementary Parties"

gen logged_ASvot = log(voteper_ASparties + 1) 	 
label variable logged_ASvot "Combined Vote Share for All Anti-System Parties (Logged)"	 
	 
*****************************************************************************************************************************************************************************************

   * Descriptive Statistics
   
reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, vce(cluster FE) 
gen used = e(sample)   
   
   sum voteper_ASparties if used == 1, det
   
   sum logged_ASvot if used == 1, det
   sum voteper_ALLRAD if used == 1, det
   sum voteper_ALLOUT if used == 1, det
  
   sum log_lagGDPpc if used == 1, det
   sum lag_rgdpnaPC if used == 1, det
  
   sum lag_growth if used == 1, det
   
   sum GEN_MainstreamPolarisation if used == 1, det
   sum ECON_MainstreamPolarisation if used == 1, det
   sum ms_maxrange if used == 1, det
   sum ms_bigrange if used == 1, det 
   
   sum log_lenep if used == 1, det
   sum lag_enep if used == 1, det
   
   sum threshold  if used == 1, det
   sum log_thresh if used == 1, det 
   
   sum log_lopen if used == 1, det 
   sum lag_openness if used == 1, det
   
   sum decentralisation if used == 1, det
   
   sum GroKo if used == 1, det

   drop used
*******************************************************************************************************************************************************************************************   

************************************************************************* MAIN ARTICLE MODELS **********************************************************************************************   
   
* Sort and declare as panel data *  //* Note results are robust to adding GDP/Lagged GDP per Capita as an additional control.
   
sort FEcountry edate
tsset FEcountry edate   
xtsum voteper_ASparties   
   
set more off, perm
numlabel, add
graph set window fontface "Times New Roman"
set scrollbufsize 300000
set scheme s1mono   
	  
stop 

******************************* TABLE 1  ***********************************

* Models 1a - 1d: Pooled OLS w/ Clustered Standard Errors *

   reg voteper_ASparties lag_growth GEN_MainstreamPolarisation, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, vce(cluster FE) 
	  
* Models 2a - 2d: Fixed Effects *
   
   xtreg voteper_ASparties   lag_growth    GEN_MainstreamPolarisation, fe 
   xtreg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation, fe 
   xtreg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, fe 
   xtreg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, fe 

         * To get correct R^2 Stat, run again manually
		   
			  reg voteper_ASparties   lag_growth    GEN_MainstreamPolarisation i.FE
              reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation i.FE
			  reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo i.FE
              reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10 i.FE
     
			  
* Table 1: Modesl 3a - 3d: Random Effects 
   
   xtreg voteper_ASparties   lag_growth    GEN_MainstreamPolarisation, re 
   xtreg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation, re 
   xtreg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, re 
   xtreg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, re 


  * Hausman Tests of No Systematic Difference Between Fixed and Random Effects Models *
   xtreg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, fe 
   estimate store fe
   xtreg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, re 
   estimates store re
  
   hausman fe re


 ******************************** ARTICLE FIGURES *******************************************  
   
reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, vce(cluster FE) 
gen used = e(sample)  		 
			 
sum lag_growth if used == 1, det
sum GEN_MainstreamPolarisation if used == 1, det		 
			   
   
* FIGURE 5: Predicted Margins

   reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, vce(cluster FE) 
	     	 
   graph set window fontface "Times New Roman"
   margins, at(lag_growth =(-10(1)12) GEN_MainstreamPolarisation = (0.55 2.05)) atmeans
			  
   marginsplot, plot(, label("{bf:Converged} ({it:1 SD Below Mean Mainstream Polarisation Score})" "{bf:Polarised} ({it:1 SD Above Mean Mainstream Polarisation Score})")) ///
			  scheme(s2mono) recastci(rarea) ylabel(0 (5) 25, nogrid val angle(0) labsize(small)) ///
			  xlabel (,nogrid val angle(0) labsize(small)) xtitle(" " "{bf:Lagged GDP Growth (%)}", ///
			  size(small)) ytitle("{bf:Predicted}" "{bf:Vote (%)}" " ", size(small) orientation(horizontal) linegap(1)) ///
			  legend(position(1) ring(0) rows(2) size(2)  title("{bf:Degree of Mainstream Party Polarisation}", size (vsmall) )) ///
			  plot1opts (msymbol(i) lpattern(dash) lwidth(medthick))  ///
			  plot2opts (msymbol(i) lpattern(solid) lwidth(medthick))  ///
			  plotregion(fcolor(white)) graphregion(fcolor(white)) ///
			  title("{bf:Figure 3.1:} Predicted Anti-System Party Vote Share" "{it:By Lagged GDP Growth and Degree of Mainstream Party Ideological Polarisation}", size(small) linegap(2)) ///
			  note("{bf:Note}: Margin Estimates and 95% Confidence Intervals from {it:Table 1, Model 1d} (Pooled OLS Model with Country-Clustered Standard Errors)" "          {it:N = 393 General Elections in 22 Advanced Democracies, 1950 - 2016}", size(vsmall) color(black) linegap(1)) ///
			  addplot(hist lag_growth, width(1)  ///
			  blcolor(black) fcolor(%20) lc(black%10) ///
			  percent  ///
			  yaxis(2)   ////
			  yscale(alt axis(2)) ///
			  ylabel(0 "0%" 5 "5%" 10 "10%" 15 "15%" 20 "20%" 25 " " 30 " " 35 " " 40 " " 45 " " 50 " ", ///
			  labcolor() axis(2) tlcolor(black) tlwidth(thin) labsize(small)) ///
			  ytitle(" " axis(2)) ///
			  legend(order( 3 "Converged" 4 "Polarised" 5 "Distribution of Elections")))


* FIGURE 6:  Predicted Margins			  
margins, at(lag_growth =(0.35871 5.00376) GEN_MainstreamPolarisation = (0.55 2.05)) atmeans
			  
 
******************************************************** ARTICLE APPENDIX *******************************************
 
 
**** TABLE D.1:  Replication of Table 1 Using Only Mainstream Polarisation on the Economic L-R Dimension 
   
   
   * Models 1a - 1d Pooled OLS w/ Clustered Standard Errors

   reg voteper_ASparties lag_growth ECON_MainstreamPolarisation, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.ECON_MainstreamPolarisation, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.ECON_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.ECON_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib7.year_10, vce(cluster FE)
   
   * Models 2a - 2d : Fixed Effects  
   
   xtreg voteper_ASparties   lag_growth    ECON_MainstreamPolarisation, fe 
   xtreg voteper_ASparties c.lag_growth##c.ECON_MainstreamPolarisation, fe 
   xtreg voteper_ASparties c.lag_growth##c.ECON_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, fe 
   xtreg voteper_ASparties c.lag_growth##c.ECON_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib7.year_10, fe 

         * To get correct R^2 Stat, run again manually
		   
		      reg voteper_ASparties   lag_growth    ECON_MainstreamPolarisation i.FE
              reg voteper_ASparties c.lag_growth##c.ECON_MainstreamPolarisation i.FE
			  reg voteper_ASparties c.lag_growth##c.ECON_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo i.FE
              reg voteper_ASparties c.lag_growth##c.ECON_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib7.year_10 i.FE
        
   * Models 3a - 3d: Random Effects
   
   xtreg voteper_ASparties   lag_growth    ECON_MainstreamPolarisation, re 
   xtreg voteper_ASparties c.lag_growth##c.ECON_MainstreamPolarisation, re 
   xtreg voteper_ASparties c.lag_growth##c.ECON_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, re 
   xtreg voteper_ASparties c.lag_growth##c.ECON_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib7.year_10, re  

   *** Essentially no change. Note corr between ECON and GEN == 0.80, ECON and SOC == 0.15, GEN AND SOC == 0.24.
  
 *******************************************************************************************************
 
 
  *** TABLE D.2: Replication of Table 1 Using Only Polarisation of Left and Rightmost Mainstream Parties
   
   
  * Models 1a - 1d Pooled OLS w/ Clustered Standard Errors

   reg voteper_ASparties lag_growth ms_maxrange, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.ms_maxrange, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.ms_maxrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.ms_maxrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, vce(cluster FE)
   
   * Models 2a - 2d : Fixed Effects  
   
   xtreg voteper_ASparties   lag_growth    ms_maxrange, fe 
   xtreg voteper_ASparties c.lag_growth##c.ms_maxrange, fe 
   xtreg voteper_ASparties c.lag_growth##c.ms_maxrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, fe 
   xtreg voteper_ASparties c.lag_growth##c.ms_maxrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, fe 

         * To get correct R^2 Stat, run again manually
		   
		      reg voteper_ASparties   lag_growth    ms_maxrange i.FE
              reg voteper_ASparties c.lag_growth##c.ms_maxrange i.FE
			  reg voteper_ASparties c.lag_growth##c.ms_maxrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo i.FE
              reg voteper_ASparties c.lag_growth##c.ms_maxrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10 i.FE
        
   * Models 3a - 3d: Random Effects
   
   xtreg voteper_ASparties   lag_growth    ms_maxrange, re 
   xtreg voteper_ASparties c.lag_growth##c.ms_maxrange, re 
   xtreg voteper_ASparties c.lag_growth##c.ms_maxrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, re 
   xtreg voteper_ASparties c.lag_growth##c.ms_maxrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, re  

 
   * Essentially no difference with my primary model.
   
 
****************************************************************************************************************************************************  
 
 
   *** TABLE D.3: Replication of Table 1 Using Only Polarisation of Largest Mainstream Parties
   
   
   * Models 1a - 1d Pooled OLS w/ Clustered Standard Errors

   reg voteper_ASparties lag_growth ms_bigrange, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.ms_bigrange, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.ms_bigrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.ms_bigrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, vce(cluster FE)
   
   * Models 2a - 2d : Fixed Effects  
   
   xtreg voteper_ASparties   lag_growth    ms_bigrange, fe 
   xtreg voteper_ASparties c.lag_growth##c.ms_bigrange, fe 
   xtreg voteper_ASparties c.lag_growth##c.ms_bigrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, fe 
   xtreg voteper_ASparties c.lag_growth##c.ms_bigrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, fe 

         * To get correct R^2 Stat, run again manually
		   
		      reg voteper_ASparties   lag_growth    ms_bigrange i.FE
              reg voteper_ASparties c.lag_growth##c.ms_bigrange i.FE
			  reg voteper_ASparties c.lag_growth##c.ms_bigrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo i.FE
              reg voteper_ASparties c.lag_growth##c.ms_bigrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10 i.FE
        
   * Models 3a - 3d: Random Effects
   
   xtreg voteper_ASparties   lag_growth    ms_bigrange, re 
   xtreg voteper_ASparties c.lag_growth##c.ms_bigrange, re 
   xtreg voteper_ASparties c.lag_growth##c.ms_bigrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, re 
   xtreg voteper_ASparties c.lag_growth##c.ms_bigrange log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, re  

 
****************************************************************************************************************
 
  *** TABLE D.4: Replication of Table 1 Using a Logged Dependent Variable
 
  * Models 1a - 1d: Pooled OLS w/ Clustered Standard Errors *

   reg logged_ASvot lag_growth GEN_MainstreamPolarisation, vce(cluster FE)
   reg logged_ASvot c.lag_growth##c.GEN_MainstreamPolarisation, vce(cluster FE)
   reg logged_ASvot c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, vce(cluster FE)
   reg logged_ASvot c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, vce(cluster FE) 

* Table 1, Models 2a - 2d: Fixed Effects *
   
   xtreg logged_ASvot   lag_growth    GEN_MainstreamPolarisation, fe 
   xtreg logged_ASvot c.lag_growth##c.GEN_MainstreamPolarisation, fe 
   xtreg logged_ASvot c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, fe 
   xtreg logged_ASvot c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, fe 

         * To get correct R^2 Stat, run again manually
		   
			  reg logged_ASvot   lag_growth    GEN_MainstreamPolarisation i.FE
              reg logged_ASvot c.lag_growth##c.GEN_MainstreamPolarisation i.FE
			  reg logged_ASvot c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo i.FE
              reg logged_ASvot c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10 i.FE
       
  
   xtreg logged_ASvot   lag_growth    GEN_MainstreamPolarisation, re 
   xtreg logged_ASvot c.lag_growth##c.GEN_MainstreamPolarisation, re 
   xtreg logged_ASvot c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo, re 
   xtreg logged_ASvot c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10, re 
  
   
**********************************************************************************************************************  
   
  *** TABLE D.5: Replication with a Lagged Dependent Variable *****
 
 * Models 1a - 1d: Pooled OLS w/ Clustered Standard Errors *

   reg voteper_ASparties lag_growth GEN_MainstreamPolarisation lag_ASP, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation lag_ASP, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo lag_ASP, vce(cluster FE)
   reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10 lag_ASP, vce(cluster FE) 

* Models 2a - 2d: Fixed Effects *
   
   xtreg voteper_ASparties   lag_growth    GEN_MainstreamPolarisation lag_ASP, fe 
   xtreg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation lag_ASP, fe 
   xtreg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo lag_ASP, fe 
   xtreg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10 lag_ASP, fe 
		 
		 	  reg voteper_ASparties   lag_growth    GEN_MainstreamPolarisation lag_ASP i.FE
              reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation lag_ASP i.FE
			  reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation lag_ASP log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo i.FE
              reg voteper_ASparties c.lag_growth##c.GEN_MainstreamPolarisation lag_ASP log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo ib1.year_10 i.FE
 
 
**********************************************************************************************************************  
   
  *** TABLE D.6: ASP Support In and Outside Recessions *****
 
 
   reg voteper_ASparties GEN_MainstreamPolarisation   log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo if recession == 0

   reg voteper_ASparties GEN_MainstreamPolarisation   log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo if recession == 1


 
 
  reg voteper_ASparties GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo i.FE if recession == 0

  reg voteper_ASparties GEN_MainstreamPolarisation log_lenep log_lopen log_lagGDPpc log_thresh decentralisation GroKo i.FE if recession == 1

 